www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15382] New: std.uri has an incorrect set of reserved characters


          Issue ID: 15382
           Summary: std.uri has an incorrect set of reserved characters
           Product: D
           Version: D2
          Hardware: Other
                OS: Other
            Status: NEW
          Severity: minor
          Priority: P4
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: dhasenan gmail.com

https://tools.ietf.org/html/rfc3986#section-2.2 says that the following
characters are reserved and may have special meaning in a URI:

:/?#[] !$&'()*+,;="

std.uri only includes the following characters in the reserved set:

;/?: &=+$,

I'm not sure how encode() and encodeComponent() are supposed to be used, so I'm
unsure what the appropriate fix would be. It looks like you're supposed to
manually escape anything that could be construed as a reserved character but
shouldn't be, then pass the rest to encode() for it to escape everything that
shouldn't appear in any URL; or alternatively encode each segment that you
don't want to have any control characters in using encodeComponent() and join
them together. But I'm not sure and it's not really documented.

Nov 26 2015