lambdaisland / uri

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

Add support for "=" within a query parameter pair #44

Closed wardle closed 1 year ago

wardle commented 1 year ago

I am parsing complex queries which may have the '=' character.

For example:

http://snomed.info/sct?fhir_vs=ecl/<<50043002:<<263502005=<<19939008

This does not parse correctly as the current handling of decode-param-pair splits against all '=' in the pair, whereas this PR splits only on the first '='.

oxalorg commented 1 year ago

LGTM! All tests pass. I also tested for multiple params with nested = and it works too!

  (is (= {:foo "aaa=bbb" :bar "ccc=ddd=eee"}
         (uri/query-map "?foo=aaa=bbb&bar=ccc=ddd=eee")))
oxalorg commented 1 year ago

@wardle Released in

[lambdaisland/uri "1.16.134"]
{lambdaisland/uri {:mvn/version "1.16.134"}}
wardle commented 1 year ago

Thank you!