-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Can't pass "hi" into DynamicDictionary #1446
Comments
Maybe this is an issue with your view. Using |
Still no luck.
public class Startup
{
public void Configuration(IAppBuilder builder)
{
builder.UseNancy();
}
} Create MainModule.cs public MainModule()
{
this.Get["/{name?}"] = _ => _.name;
} Make sure use OwinHost as server. |
Have you followed this? https://github.com/NancyFx/Nancy/wiki/Hosting-nancy-with-owin |
Yes, I do read this. |
@scott-xu can you put together a repro project on github that we can download and run? Thx. |
@scott-xu "on github" thx. |
Thanks @scott-xu , looking at it now. |
Ok, we've gotten to the bottom of it, it's down to localisation. One of the default conventions NAncy uses to determine the current request locale is look at the start of the path, if it matches a locale string then it strips it, sets the locale and continues. Unfortunately, as a side effect of supporting partial locals (so en rather then en-GB) that means we're stripping quite a lot of innocent two letter parameters. I think the best solution to this is to disable that convention by default - it's simple enough to put back in. |
This is really a very strange thing:
When I navigate to http://localhost/abc or http://localhost/blablabla, I can get the name property as expected. But when I navigate to http://localhost/hi, I can't get it. The dynamic dictionary is empty (count equals 0)
The text was updated successfully, but these errors were encountered: