wtetzner / exploding-fish

A URI library for Clojure
Other
150 stars 12 forks source link

Mixing param & param-raw has unexpected results #26

Open ignorabilis opened 5 years ago

ignorabilis commented 5 years ago

Snippet:

(uri/param
  (uri/param-raw
    (uri/uri "https://aaa.com")
    "a"
    "http://localhost:1111/user")
  "b"
  "something else")

produces this: #<Uri https://aaa.com?a=http%3A%2F%2Flocalhost%3A1111%2Fuser&b=something+else>

My expectation was parameters to be added without the other parameteres being modified.

wtetzner commented 5 years ago

That's a good point. The way things are implemented now, when you do uri/param, it decodes everything, adds your new parameter, and re-encodes everything.

But I think you're right that it could be unexpected behavior. I'll look into fixing it.

ignorabilis commented 5 years ago

@wtetzner - great, thanks a lot!