| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b9567d9 commit 08c2512
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -172,6 +172,7 @@ Url.prototype.parse = function parse(url, parseQueryString, slashesDenoteHost) { | |||
| 172 | 172 | // Back slashes before the query string get converted to forward slashes | |
| 173 | 173 | // See: https://code.google.com/p/chromium/issues/detail?id=25916 | |
| 174 | 174 | let hasHash = false; | |
| 175 | + let hasAt = false; | ||
| 175 | 176 | let start = -1; | |
| 176 | 177 | let end = -1; | |
| 177 | 178 | let rest = ''; | |
@@ -204,6 +205,9 @@ Url.prototype.parse = function parse(url, parseQueryString, slashesDenoteHost) { | |||
| 204 | 205 | // Only convert backslashes while we haven't seen a split character | |
| 205 | 206 | if (!split) { | |
| 206 | 207 | switch (code) { | |
| 208 | + case CHAR_AT: | ||
| 209 | + hasAt = true; | ||
| 210 | + break; | ||
| 207 | 211 | case CHAR_HASH: | |
| 208 | 212 | hasHash = true; | |
| 209 | 213 | // Fall through | |
@@ -244,7 +248,7 @@ Url.prototype.parse = function parse(url, parseQueryString, slashesDenoteHost) { | |||
| 244 | 248 | } | |
| 245 | 249 | } | |
| 246 | 250 | ||
| 247 | - if (!slashesDenoteHost && !hasHash) { | ||
| 251 | + if (!slashesDenoteHost && !hasHash && !hasAt) { | ||
| 248 | 252 | // Try fast path regexp | |
| 249 | 253 | const simplePath = simplePathPattern.exec(rest); | |
| 250 | 254 | if (simplePath) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -946,7 +946,37 @@ const parseTests = { | |||
| 946 | 946 | pathname: '/', | |
| 947 | 947 | path: '/', | |
| 948 | 948 | href: 'wss://www.example.com/' | |
| 949 | - } | ||
| 949 | + }, | ||
| 950 | + | ||
| 951 | + '//fhqwhgads@example.com/everybody-to-the-limit': { | ||
| 952 | + protocol: null, | ||
| 953 | + slashes: true, | ||
| 954 | + auth: 'fhqwhgads', | ||
| 955 | + host: 'example.com', | ||
| 956 | + port: null, | ||
| 957 | + hostname: 'example.com', | ||
| 958 | + hash: null, | ||
| 959 | + search: null, | ||
| 960 | + query: null, | ||
| 961 | + pathname: '/everybody-to-the-limit', | ||
| 962 | + path: '/everybody-to-the-limit', | ||
| 963 | + href: '//fhqwhgads@example.com/everybody-to-the-limit' | ||
| 964 | + }, | ||
| 965 | + | ||
| 966 | + '//fhqwhgads@example.com/everybody#to-the-limit': { | ||
| 967 | + protocol: null, | ||
| 968 | + slashes: true, | ||
| 969 | + auth: 'fhqwhgads', | ||
| 970 | + host: 'example.com', | ||
| 971 | + port: null, | ||
| 972 | + hostname: 'example.com', | ||
| 973 | + hash: '#to-the-limit', | ||
| 974 | + search: null, | ||
| 975 | + query: null, | ||
| 976 | + pathname: '/everybody', | ||
| 977 | + path: '/everybody', | ||
| 978 | + href: '//fhqwhgads@example.com/everybody#to-the-limit' | ||
| 979 | + }, | ||
| 950 | 980 | }; | |
| 951 | 981 | ||
| 952 | 982 | for (const u in parseTests) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments