Index: Source/devtools/front_end/common/ParsedURL.js |
diff --git a/Source/devtools/front_end/common/ParsedURL.js b/Source/devtools/front_end/common/ParsedURL.js |
index c98a54c542775be3bc412faaa05f6d8da7d9dab7..7e9c73af7706b3287916f403edf0a93f434393b7 100644 |
--- a/Source/devtools/front_end/common/ParsedURL.js |
+++ b/Source/devtools/front_end/common/ParsedURL.js |
@@ -121,39 +121,6 @@ WebInspector.ParsedURL.splitURL = function(url) |
} |
/** |
- * http://tools.ietf.org/html/rfc3986#section-5.2.4 |
- * @param {string} path |
- * @return {string} |
- */ |
- |
-WebInspector.ParsedURL.normalizePath = function(path) |
-{ |
- if (path.indexOf("..") === -1 && path.indexOf('.') === -1) |
- return path; |
- |
- var normalizedSegments = []; |
- var segments = path.split("/"); |
- for (var i = 0; i < segments.length; i++) { |
- var segment = segments[i]; |
- if (segment === ".") |
- continue; |
- else if (segment === "..") |
- normalizedSegments.pop(); |
- else if (segment) |
- normalizedSegments.push(segment); |
- } |
- var normalizedPath = normalizedSegments.join("/"); |
- if (normalizedPath[normalizedPath.length - 1] === "/") |
- return normalizedPath; |
- if (path[0] === "/" && normalizedPath) |
- normalizedPath = "/" + normalizedPath; |
- if ((path[path.length - 1] === "/") || (segments[segments.length - 1] === ".") || (segments[segments.length - 1] === "..")) |
- normalizedPath = normalizedPath + "/"; |
- |
- return normalizedPath; |
-} |
- |
-/** |
* @param {string} baseURL |
* @param {string} href |
* @return {?string} |
@@ -214,7 +181,7 @@ WebInspector.ParsedURL.completeURL = function(baseURL, href) |
// href starts with "//" which is a full URL with the protocol dropped (use the baseURL protocol). |
return parsedURL.scheme + ":" + path + postfix; |
} // else absolute path |
- return parsedURL.scheme + "://" + parsedURL.host + (parsedURL.port ? (":" + parsedURL.port) : "") + WebInspector.ParsedURL.normalizePath(path) + postfix; |
+ return parsedURL.scheme + "://" + parsedURL.host + (parsedURL.port ? (":" + parsedURL.port) : "") + normalizePath(path) + postfix; |
} |
return null; |
} |