Skip to content

Commit a1d0da2

Browse files
committed
test: generate only relative path references
1 parent 9eb8759 commit a1d0da2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎test/relative-normalization-security.test.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ test('property: normalization of relative references is resolution-preserving an
8989
const parts = []
9090
for (let j = 0; j < length; j++) parts.push(segments[next(segments.length)])
9191
const ref = parts.join('/')
92-
// Only relative-path references: empty refs and refs starting with "/"
93-
// are not affected by this change ("//" would also introduce an authority).
94-
if (ref === '' || ref[0] === '/') continue
92+
// Only relative-path references: empty refs, refs starting with "/", and
93+
// refs whose first segment contains ":" are not affected by this change.
94+
if (ref === '' || ref[0] === '/' || fastURI.parse(ref).scheme !== undefined) continue
9595

9696
checked++
9797
const normalized = fastURI.normalize(ref)

0 commit comments

Comments
 (0)