File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 11#include < algorithm>
22#include < string>
3+ #include < cstring>
34#include < iterator>
45#include < unordered_map>
56#include < unordered_set>
@@ -266,6 +267,15 @@ namespace Url
266267 }
267268 }
268269
270+ // Windows file path
271+ if ((strncmp (scheme_.c_str (), " file" , 4 ) == 0 ) &&
272+ (static_cast <int >(url.length () - position) >= 2
273+ && url[position] == ' /'
274+ && url[position + 2 ] == ' :' ))
275+ {
276+ position += 1 ;
277+ }
278+
269279 if (position != std::string::npos)
270280 {
271281 path_.assign (url, position, std::string::npos);
@@ -443,7 +453,8 @@ namespace Url
443453 }
444454 else
445455 {
446- if (!host_.empty () && path_[0 ] != ' /' )
456+ if ((!host_.empty () && path_[0 ] != ' /' ) ||
457+ (host_.empty () && path_[0 ] != ' /' && path_[1 ] == ' :' ))
447458 {
448459 result.append (1 , ' /' );
449460 }
You can’t perform that action at this time.
0 commit comments