| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b825b3c commit 3666879
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -38,6 +38,7 @@ function Url() { | |||
| 38 | 38 | // compiled once on the first module load. | |
| 39 | 39 | const protocolPattern = /^([a-z0-9.+-]+:)/i; | |
| 40 | 40 | const portPattern = /:[0-9]*$/; | |
| 41 | + const hostPattern = /^\/\/[^@/]+@[^@/]+/; | ||
| 41 | 42 | ||
| 42 | 43 | // Special case for a simple path URL | |
| 43 | 44 | const simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/; | |
@@ -200,7 +201,7 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { | |||
| 200 | 201 | // user@server is *always* interpreted as a hostname, and url | |
| 201 | 202 | // resolution will treat //foo/bar as host=foo,path=bar because that's | |
| 202 | 203 | // how the browser resolves relative URLs. | |
| 203 | - if (slashesDenoteHost || proto || /^\/\/[^@/]+@[^@/]+/.test(rest)) { | ||
| 204 | + if (slashesDenoteHost || proto || hostPattern.test(rest)) { | ||
| 204 | 205 | var slashes = rest.charCodeAt(0) === 47/*/*/ && | |
| 205 | 206 | rest.charCodeAt(1) === 47/*/*/; | |
| 206 | 207 | if (slashes && !(proto && hostlessProtocol[proto])) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments