Open dan-da opened 4 years ago
I posted a more complete example here: https://stackoverflow.com/questions/62335488/how-to-obtain-raw-url-path-in-rust
wow, it's been over a year and our code still has an ugly workaround. any comment about this?
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
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.
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.