Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

Route issue #2579

Closed
Radzhab opened this issue Sep 30, 2016 · 11 comments
Closed

Route issue #2579

Radzhab opened this issue Sep 30, 2016 · 11 comments

Comments

@Radzhab
Copy link

Radzhab commented Sep 30, 2016

I have route
Get["/{url}/{printer}"]

If i send this url to Chrome all work fine
localhost:8888/yandex.ru/HP Universal Printing PCL 6

Then i try send this url, but route not work.
localhost:8888/http://www.yandex.ru/HP Universal Printing PCL 6

I also try HttpUtility.UrlEncode("http://www.yandex.ru"); but it not work too.
localhost:8888/http%3a%2f%2fwww.yandex.ru/HP Universal Printing PCL 6

404 - NotFound
The resource you have requested cannot be found.

We're sorry :-(

@khellang
Copy link
Member

khellang commented Sep 30, 2016

The issue template is there for a reason. It's asking you to fill out the details, like which versions you're using, which host your running etc., so we don't have to.

But here we are... asking; what host and what versions are you using? 😝

@thecodejunkie
Copy link
Member

There's also a duplicate Stack Overflow question for this by @Radzhab http://stackoverflow.com/questions/39785864/how-pass-url-params-to-route

@grumpydev
Copy link
Member

This looks like the old "twice decoding" thing?

@phillip-haydon
Copy link
Member

phillip-haydon commented Sep 30, 2016

Double encoding would resolve the issue:

localhost:8888/http://www.yandex.ru/HP Universal Printing PCL 6

When this is either not encoded, or is encoded (once), the URL is decoded and end's up being split on the //.

@Radzhab
Copy link
Author

Radzhab commented Sep 30, 2016

I use 1.4.1.0 version

@khellang
Copy link
Member

And the host?

@Radzhab
Copy link
Author

Radzhab commented Sep 30, 2016

https://gist.github.com/Radzhab/46abc95cdfe4b018ad3c9a8dae7003ca
Nancy.dll 1.4.1
Nancy.Hosting.Self.dll 1.4.1
Mono.Posix.dll 4.0.0

@khellang
Copy link
Member

khellang commented Sep 30, 2016

Yeah, that's probably the double-decoding issue that affected self-hosting. This was fixed in #2462

You either have to update to one of the 2.0 pre-release versions or double encode the value you're passing in 😢

@Radzhab
Copy link
Author

Radzhab commented Oct 3, 2016

I intall pre-release but it all the same - not work.. I try this url
localhost:8888/https%3A%2F%2Fwww.google.com%2F2
and localhost:8888/https%3A%2F%2Fwww.google.com/F2

@phillip-haydon
Copy link
Member

So double encoding did not work for you @Radzhab? Hmmm it should because we only decode the route once. That's strange.

I have some free time tonight so I'll try reproduce this and see if there's a quick work around to unblock you.

@Radzhab
Copy link
Author

Radzhab commented Oct 4, 2016

update.......

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants