lambdaisland / uri

A pure Clojure/ClojureScript URI library
Mozilla Public License 2.0
243 stars 21 forks source link

Trim uri before parse #45

Closed velios closed 10 months ago

velios commented 10 months ago

First of all, thx for you amazing and very helpful library.

About PR. I'm not sure the suggested argument pre-processing is appropriate. But I think the resulting parsing results can be misleading.

(into {} (uri/parse "  https://example.com/path  "))
=>
{:scheme "  https",
 :user nil,
 :password nil,
 :host "example.com",
 :port nil,
 :path "/path  ",
 :query nil,
 :fragment nil}
velios commented 10 months ago

Don't understand why openjdk8 checks not passed. Changes was trivial.

plexus commented 10 months ago

While trimming at the start seems mostly harmless, trimming at the end does have the potential to introduce unwanted breaking changes. People might be using uri to further normalize the path segment to /path%20%20. I think this is a case of "garbage-in garbage-out", where it's the caller's responsibility to provide reasonable input.

Thank you for your PR, but unfortunately we are not going to accept it at this time.