Commit ab0f7611 authored by Uzondu Enudeme's avatar Uzondu Enudeme Committed by Emmanuel Odeke
Browse files

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: default avatarIan Lance Taylor <iant@golang.org>
Reviewed-by: default avatarEmmanuel Odeke <emmanuel@orijtech.com>
Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
parent 3c2e73c8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment