This repository has been archived by the owner on Jan 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Reduced the number of new dictionaries being created by only creating a new one at result creation time, and only if necessary. Be nice if there was a read only dictionary for this, but that's 4.5 only :)
} | ||
|
||
|
||
//if (capturedParameters.Any()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dead code
Hi, The error occurs as following:
public HomeModule()
{
Get["test.html"] = _ => "OK";
// Get["/test.html"] = _ => "OK"; tried this too
Get["/"] = _ => "Hello world";
}
Nancy.RequestExecutionException: Oh noes! ---> System.NullReferenceException: Object reference not set to an instance of an object. at Nancy.Routing.Trie.Nodes.TrieNode.d__7.MoveNext() at System.Linq.Buffer`1..ctor(IEnumerable`1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) at Nancy.Routing.Trie.RouteResolverTrie.GetMatches(String method, String path, NancyContext context) at Nancy.Routing.DefaultRouteResolver.Resolve(NancyContext context) at Nancy.Routing.DefaultRequestDispatcher.InvokeRouteResolver(NancyContext context, String path, IEnumerable`1 acceptHeaders) at Nancy.Routing.DefaultRequestDispatcher.Resolve(NancyContext context) at Nancy.Routing.DefaultRequestDispatcher.Dispatch(NancyContext context) at Nancy.NancyEngine.InvokeRequestLifeCycle(NancyContext context, IPipelines pipelines) --- End of inner exception stack trace --- at Nancy.NancyEngine.InvokeOnErrorHook(NancyContext context, ErrorPipeline pipeline, Exception ex) Tested using chrome versions prior this (0.16.1) works as usual, same code. |
Hi guys, |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Switched from the old approach to a route Trie, which is faster, and much more readable.
Also removed the Indiana Jones and the Tuple of Doom that the old route resolver was returning and replaced it with a class.
Routing should (hopefully) be unaffected, but to be clear the new system works on route length and scoring as follows:
The full set of node types are:
Note that now captures are not greedy by default, you need to specify the greedy capture if that's the behaviour you want (this fixes #785)