wtetzner / exploding-fish

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

Weird path handling #22

Closed valerauko closed 6 years ago

valerauko commented 6 years ago

Using 0.3.5, I can't seem to update the path in an URI (at least not simply).

user=> (require '(org.bovinegenius [exploding-fish :as uri]))
nil
user=> (def my-uri (uri/uri {:scheme "http" :host "localhost" :port 3000}))
#'user/my-uri
user=> (uri/path my-uri)
nil
user=> (uri/path (str my-uri) "/foo")
"http://localhost:3000/foo"
user=> (str (uri/path my-uri "/foo"))
"http:/foo"

It works if I first convert my URI to a string, but that feels roundabout.

Is this expected behaviour, and if so is there a way to update the path without string it first?

wtetzner commented 6 years ago

This definitely looks like a bug.

valerauko commented 6 years ago

Thanks for the lightning fast fix!