fetchItem: don't treat UNC paths as protocol-relative URLs.

These are paths beginning `//?/UNC/...`.  Closes #5127.
This commit is contained in:
John MacFarlane 2019-03-22 11:22:21 -07:00
parent b3473df417
commit 97acf152e0

View file

@ -569,7 +569,8 @@ downloadOrRead s = do
case parseURIReference' s' of
Just u' -> openURL $ show $ u' `nonStrictRelativeTo` u
Nothing -> openURL s' -- will throw error
(Nothing, s'@('/':'/':_)) -> -- protocol-relative URI
(Nothing, s'@('/':'/':c:_)) | c /= '?' -> -- protocol-relative URI
-- we exclude //? because of //?UNC/ on Windows
case parseURIReference' s' of
Just u' -> openURL $ show $ u' `nonStrictRelativeTo` httpcolon
Nothing -> openURL s' -- will throw error