(path, url, base)
| 9339 | * do not include drive names for routing. |
| 9340 | */ |
| 9341 | function removeWindowsDriveName (path, url, base) { |
| 9342 | /* |
| 9343 | Matches paths for file protocol on windows, |
| 9344 | such as /C:/foo/bar, and captures only /foo/bar. |
| 9345 | */ |
| 9346 | var windowsFilePathExp = /^\/[A-Z]:(\/.*)/; |
| 9347 | |
| 9348 | var firstPathSegmentMatch; |
| 9349 | |
| 9350 | //Get the relative path from the input URL. |
| 9351 | if (url.indexOf(base) === 0) { |
| 9352 | url = url.replace(base, ''); |
| 9353 | } |
| 9354 | |
| 9355 | // The input URL intentionally contains a first path segment that ends with a colon. |
| 9356 | if (windowsFilePathExp.exec(url)) { |
| 9357 | return path; |
| 9358 | } |
| 9359 | |
| 9360 | firstPathSegmentMatch = windowsFilePathExp.exec(path); |
| 9361 | return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path; |
| 9362 | } |
| 9363 | }; |
| 9364 | |
| 9365 | /** |
no outgoing calls
no test coverage detected