Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement request: path_raw() #602

Open
dan-da opened this issue Jun 10, 2020 · 4 comments
Open

enhancement request: path_raw() #602

dan-da opened this issue Jun 10, 2020 · 4 comments

Comments

@dan-da
Copy link

dan-da commented Jun 10, 2020

Sometimes one just wants to parse the raw url components and display/log/process them exactly as entered, without any normalization.

At present, I am in need of the exact string in the path, including "../" without any normalization. I can perform the percent-decoding if necessary.

If I've overlooked an existing way to do this, please advise.

@dan-da
Copy link
Author

dan-da commented Jun 12, 2020

I posted a more complete example here:
https://stackoverflow.com/questions/62335488/how-to-obtain-raw-url-path-in-rust

@dan-da
Copy link
Author

dan-da commented Aug 13, 2021

wow, it's been over a year and our code still has an ugly workaround. any comment about this?

@tmccombs
Copy link
Contributor

I think that the original path is lost during parsing. I think that this would have to be an option during parsing, not a method on Url

@dan-da
Copy link
Author

dan-da commented Aug 14, 2021

maybe there could be a parse option to not throw it away...

anyway, I'm not stuck on the exact impl, so long as its possible to obtain somehow. Seems like presently ::parse() is more of parse+transform rather than just parsing. I think one should be able to get at each of the raw parsed components (scheme, user, pass, host, port, path, query-string, fragment), before they go through transformations (decoding, path normalization, etc). maybe add a parse_raw() fn.

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

No branches or pull requests

2 participants