-
Notifications
You must be signed in to change notification settings - Fork 17.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net/url: add OmitHost bool to url.URL
Previously, myscheme:/path and myscheme:///path were treated as the same URL although materially different. The distinction made clear by RFC 3986 sec. 5.3 where a different recomposition behavior is expected when a URI reference has an undefined host(authority) as in myscheme:/path vs. one with an empty host(authority) as in myscheme:///path. This change fixes the Parse/String roundtrip limitation for URLs with an undefined host and a single slash. Fixes #46059 Change-Id: I1b8d6042135513616374ff8c8dfb1cdb640f8efe Reviewed-on: https://go-review.googlesource.com/c/go/+/391294 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com> Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com> TryBot-Result: Gopher Robot <gobot@golang.org>
- Loading branch information
Showing
2 changed files
with
26 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters