bare-url 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/parse.js +5 -5
- package/lib/serialize.js +1 -1
- package/package.json +1 -1
package/lib/parse.js
CHANGED
|
@@ -95,7 +95,7 @@ module.exports = function parse (
|
|
|
95
95
|
} else if (!stateOverride) {
|
|
96
96
|
buffer = ''
|
|
97
97
|
state = constants.STATE_NO_SCHEME
|
|
98
|
-
pointer =
|
|
98
|
+
pointer = -1
|
|
99
99
|
} else {
|
|
100
100
|
throw errors.INVALID_URL()
|
|
101
101
|
}
|
|
@@ -203,7 +203,7 @@ module.exports = function parse (
|
|
|
203
203
|
|
|
204
204
|
// https://url.spec.whatwg.org/#special-authority-ignore-slashes-state
|
|
205
205
|
case constants.STATE_SPECIAL_AUTHORITY_IGNORE_SLASHES:
|
|
206
|
-
if (c !== 0x2f
|
|
206
|
+
if (c !== 0x2f && c !== 0x5c) {
|
|
207
207
|
state = constants.STATE_AUTHORITY
|
|
208
208
|
pointer--
|
|
209
209
|
}
|
|
@@ -412,7 +412,7 @@ module.exports = function parse (
|
|
|
412
412
|
if (isSpecial(url)) {
|
|
413
413
|
state = constants.STATE_PATH
|
|
414
414
|
|
|
415
|
-
if (c !== 0x2f
|
|
415
|
+
if (c !== 0x2f && c !== 0x5c) pointer--
|
|
416
416
|
} else if (!stateOverride && c === 0x3f) {
|
|
417
417
|
url.query = ''
|
|
418
418
|
state = constants.STATE_QUERY
|
|
@@ -438,11 +438,11 @@ module.exports = function parse (
|
|
|
438
438
|
if (isDoubleDotPathSegment(buffer)) {
|
|
439
439
|
shortenPath(url)
|
|
440
440
|
|
|
441
|
-
if (c !== 0x2f
|
|
441
|
+
if (c !== 0x2f && !isSpecial(url) && c === 0x5c) {
|
|
442
442
|
url.path.push('')
|
|
443
443
|
}
|
|
444
444
|
} else if (isSingleDotPathSegment(buffer)) {
|
|
445
|
-
if (c !== 0x2f
|
|
445
|
+
if (c !== 0x2f && !isSpecial(url) && c === 0x5c) {
|
|
446
446
|
url.path.push('')
|
|
447
447
|
}
|
|
448
448
|
} else {
|
package/lib/serialize.js
CHANGED