Commit c1834554 authored by valenting's avatar valenting
Browse files

Bug 1858570 - Fix relative URL path starting with multiple slashes...

Bug 1858570 - Fix relative URL path starting with multiple slashes r=necko-reviewers,kershaw a=RyanVM

Differential Revision: https://phabricator.services.mozilla.com/D190784
parent 86c8e1ee
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -2710,7 +2710,15 @@ nsStandardURL::Resolve(const nsACString& in, nsACString& out) {
    // locate result path
    resultPath = strstr(result, "://");
    if (resultPath) {
      resultPath = 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() && Scheme() != "file") {
        while (*resultPath == '/') {
          resultPath++;
        }
      }
      resultPath = strchr(resultPath, '/');
      if (resultPath) {
        net_CoalesceDirs(coalesceFlag, resultPath);
      }