You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Parse function in the net/url package does not properly handle a file URL with a Windows path. It should place the entire local path after the file:// in the Path field on the URL object, as on Unix/Linux, but it does not. If the path is specified entirely using backslashes, then it will be placed in the Host field. If it is specified using forward slashes or some combination of backslashes and forward slashes, then the portion before the first forward slash will be placed in the Host field and the remainder will be placed in the Path field. For example, the URL file://C:\Windows\System32\kernel32.dll parses to {Host: "C:\Windows\System32\kernel32.dll"} and the URL file://C:\Windows\System32/kernel32.dll parses to {Host: "C:\Windows\System32", Path: "/kernel32.dll"}. They should instead parse to {Path: "C:\Windows\System32\kernel32.dll"} and {Path: "C:\Windows\System32/kernel32.dll"}, respectively.
The text was updated successfully, but these errors were encountered:
The
Parse
function in thenet/url
package does not properly handle a file URL with a Windows path. It should place the entire local path after thefile://
in thePath
field on theURL
object, as on Unix/Linux, but it does not. If the path is specified entirely using backslashes, then it will be placed in theHost
field. If it is specified using forward slashes or some combination of backslashes and forward slashes, then the portion before the first forward slash will be placed in theHost
field and the remainder will be placed in thePath
field. For example, the URLfile://C:\Windows\System32\kernel32.dll
parses to{Host: "C:\Windows\System32\kernel32.dll"}
and the URLfile://C:\Windows\System32/kernel32.dll
parses to{Host: "C:\Windows\System32", Path: "/kernel32.dll"}
. They should instead parse to{Path: "C:\Windows\System32\kernel32.dll"}
and{Path: "C:\Windows\System32/kernel32.dll"}
, respectively.The text was updated successfully, but these errors were encountered: