• Kale Blankenship's avatar
    net/url: prefix relative paths containing ":" in the first segment with "./" · ad5d91c1
    Kale Blankenship authored
    This change modifies URL.String to prepend "./" to a relative URL which
    contains a colon in the first path segment.
    
    Per RFC 3986 §4.2:
    
    > A path segment that contains a colon character (e.g., "this:that")
    > cannot be used as the first segment of a relative-path reference, as
    > it would be mistaken for a scheme name.  Such a segment must be
    > preceded by a dot-segment (e.g., "./this:that") to make a relative-
    > path reference.
    
    https://go-review.googlesource.com/27440 corrects the behavior for http.FileServer,
    but URL.String will still return an invalid URL. This CL reverts the changes to
    http.FileServer as they are unnecessary with this fix.
    
    Fixes #17184
    
    Change-Id: I9211ae20f82c91b785d1b079b2cd766487d94225
    Reviewed-on: https://go-review.googlesource.com/29610Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    ad5d91c1
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...