urlapi: support UNC paths in file: URLs on Windows

- file://host.name/path/file.txt is a valid UNC path
  \\host.name\path\files.txt to a non-local file transformed into URI
  (RFC 8089 Appendix E.3)

- UNC paths on other OSs must be smb: URLs

Closes #7366
This commit is contained in:
Sergey Markelov 2021-09-27 08:31:52 +02:00 committed by Daniel Stenberg
parent 3363eeb262
commit 4b997626b1
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 38 additions and 6 deletions

Binary file not shown.

View file

@ -187,6 +187,10 @@ static const struct testcase get_parts_list[] ={
{"file:///C:\\programs\\foo",
"file | [11] | [12] | [13] | [14] | [15] | C:\\programs\\foo | [16] | [17]",
CURLU_DEFAULT_SCHEME, 0, CURLUE_OK},
{"file://host.example.com/Share/path/to/file.txt",
"file | [11] | [12] | [13] | host.example.com | [15] | "
"//host.example.com/Share/path/to/file.txt | [16] | [17]",
CURLU_DEFAULT_SCHEME, 0, CURLUE_OK},
#endif
{"https://example.com/color/#green?no-red",
"https | [11] | [12] | [13] | example.com | [15] | /color/ | [16] | "