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

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Nov 26 17:06:17 PST 2015


https://issues.dlang.org/show_bug.cgi?id=15382

          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 at puremagic.com
          Reporter: dhasenan at 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.

--


More information about the Digitalmars-d-bugs mailing list