Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

HttpRequestFeature.Path does not match the request if contains encoded url #782

Closed
UnoSD opened this issue Mar 2, 2017 · 2 comments
Closed
Assignees

Comments

@UnoSD
Copy link

UnoSD commented Mar 2, 2017

I am sending a simple request with the following URL:

http://localhost:5000/secrets/http%3A%2F%2Fwww.g

When I look at the Path property of the HttpRequestFeature, it contains:

/secrets/http:%252F%252Fwww.g

Instead of the expected value from the original URL. It looks like it has decoded the : and re-encoded the %.

I tried to track back to the setting of the property on the creation of the request from the context, but I get a bit lost in the feature collection, I am happy to help fixing this if someone could point me in the right direction.

@Tratcher Tratcher added the bug label Mar 2, 2017
@Tratcher
Copy link
Member

Tratcher commented Mar 2, 2017

The un-escaping of %3A is happening in the server (Kestrel/WebListener).

The double escaping of %2F to %252F is happening in PathString.ToUriComponent(). We should make this smart enough to recognize %XX and avoid double escaping.

@UnoSD
Copy link
Author

UnoSD commented Mar 2, 2017

@Tratcher Thanks, I'll have a glance at the Kestrel source.

Just for my understanding, why is it escaping at all? From the server perspective %2F is just a literal value part of the URL.

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

No branches or pull requests

4 participants