lambdaisland / uri

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

normalize should ignore "sub-delims" #14

Closed plexus closed 4 years ago

plexus commented 4 years ago

The rfc (search for "sub-delims") has a number of reserved characters, for which the percent-encoded and decoded values are not equivalent, for instance = or &. normalize treats a query string as a single thing, so that leads to problems

(uri/query-map (uri/uri "?foo=%20%2B%26xxx%3D123"))
;;=> {:foo " +&xxx=123"}
(uri/query-map (normalize/normalize (uri/uri "?foo=%20%2B%26xxx%3D123")))
;;=> {:foo " +", :xxx "123"}