[plt-scheme] Second teeny little net/url bug

From: Synx (plt at synx.us.to)
Date: Wed Sep 30 18:59:09 EDT 2009

Oh look I found two bugs in one day! :( I'm so lucky.

(url->string (string->url
"http://some.server.com/path/with%3Acolons/in%3Ait/and%25spaces"))
=> "http://some.server.com/path/with:colons/in:it/and%25spaces"

I tried double encoding something thus:

(url->string
  (string->url
    (uri-encode (uri-encode "not:a:schema/but a relative/url"))))

=> "not%253Aa%253Aschema%252Fbut%2520a%2520relative%252Furl"

...which is correct.

So it handles space/%25 just fine, but colon gets encoded, decoded, but
never encoded again when it ought to be. That makes it impossible to
make a relative url whose path contains colons, as (url->string) returns
unescaped colons, which are treated as delimiters for the schema.


Posted on the users mailing list.