Closed Falmarri closed 10 years ago
Thanks!
Your example definitely needs to be fixed, but I'm not sure we should do it by filtering out all empty path parts. If someone parses a URL "http://www.example.com/hi//bye", I don't think we should flatten it to "http://www.example.com/hi/bye"
WDYT?
That's a good question. I think in general, normalizing the path would be OK. I think it would be a pretty esoteric use case to want "//" in a url, I can't think of a time I've ever seen that in the wild.
Maybe instead of filter use dropWhile?
I agree it is esoteric, but since it is a valid URL against the spec I would like to support it.
I have pushed a fix and some unit tests in 06ee51f and published a new 0.0.4-SNAPSHOT
. Could you give this a test?
Yeah that fixed my specific issue.
This fixes an error where a string parsed to a URI without a path part got an empty pathpart. This resulted in an extra "/" being put at the begging of the query. That is:
scala> ("http://test.com:8080" / "something").toString res10: String = http://test.com:8080//something