[Network] Fix relative URL path starting with multiple slashes

This commit is contained in:
Moonchild
2023-11-23 16:08:26 +01:00
committed by roytam1
parent 71ce058b03
commit d55111c4fd
+9 -1
View File
@@ -2541,7 +2541,15 @@ nsStandardURL::Resolve(const nsACString &in, nsACString &out)
// locate result path
resultPath = PL_strstr(result, "://");
if (resultPath) {
resultPath = PL_strchr(resultPath + 3, '/');
// If there are multiple slashes after :// we must ignore them
// otherwise net_CoalesceDirs may think the host is a part of the path.
resultPath += 3;
if (protocol.IsEmpty() && !SegmentIs(mScheme,"file")) {
while (*resultPath == '/') {
resultPath++;
}
}
resultPath = PL_strchr(resultPath, '/');
if (resultPath)
net_CoalesceDirs(coalesceFlag,resultPath);
}