(path, url, base)
| 14684 | * do not include drive names for routing. |
| 14685 | */ |
| 14686 | function removeWindowsDriveName(path, url, base) { |
| 14687 | /* |
| 14688 | Matches paths for file protocol on windows, |
| 14689 | such as /C:/foo/bar, and captures only /foo/bar. |
| 14690 | */ |
| 14691 | var windowsFilePathExp = /^\/[A-Z]:(\/.*)/; |
| 14692 | |
| 14693 | var firstPathSegmentMatch; |
| 14694 | |
| 14695 | //Get the relative path from the input URL. |
| 14696 | if (startsWith(url, base)) { |
| 14697 | url = url.replace(base, ''); |
| 14698 | } |
| 14699 | |
| 14700 | // The input URL intentionally contains a first path segment that ends with a colon. |
| 14701 | if (windowsFilePathExp.exec(url)) { |
| 14702 | return path; |
| 14703 | } |
| 14704 | |
| 14705 | firstPathSegmentMatch = windowsFilePathExp.exec(path); |
| 14706 | return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path; |
| 14707 | } |
| 14708 | }; |
| 14709 | |
| 14710 | this.$$normalizeUrl = function(url) { |
no test coverage detected