summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libproxy/test/url-test.cpp22
-rw-r--r--libproxy/url.cpp2
2 files changed, 24 insertions, 0 deletions
diff --git a/libproxy/test/url-test.cpp b/libproxy/test/url-test.cpp
index b66ae35..f5ede04 100644
--- a/libproxy/test/url-test.cpp
+++ b/libproxy/test/url-test.cpp
@@ -145,6 +145,28 @@ int main()
"", 80,
"");
+ /* Check windows style URL */
+ try_url ("file:///E:/dir/file.pac", rtv,
+ "file",
+ "", "",
+ "", 0,
+#ifdef WIN32
+ "E:\\dir\\file.pac");
+#else
+ "/E:/dir/file.pac");
+#endif
+
+ /* UNC windows URL */
+ try_url ("file://server/dir/file.pac", rtv,
+ "file",
+ "", "",
+ "server", 0,
+#ifdef WIN32
+ "\\\\server\\dir\\file.pac");
+#else
+ "/dir/file.pac");
+#endif
+
#ifdef WIN32
WSACleanup();
#endif
diff --git a/libproxy/url.cpp b/libproxy/url.cpp
index cd781df..d00adfd 100644
--- a/libproxy/url.cpp
+++ b/libproxy/url.cpp
@@ -212,6 +212,8 @@ url::url(const string &url) throw(parse_error)
host_end = string::npos;
} else {
host_end = hier_part.find(':', host_start);
+ if (path_start < host_end)
+ host_end = path_start;
}
/* If not port, host ends where path starts */