Skip to content

Commit 7ab3c73

Browse files
committed
URI removeDotSegments only ensures preceding '/' if was already absolute.
1 parent 8800bcb commit 7ab3c73

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Always pass typeScopedContext to _expandObject.
77
- Allow a keyword to exist when expanding in _expandObject when the key is `@included` or `@type`.
88
- Improve isDouble to look for big integers.
9+
- URI removeDotSegments only ensures preceding '/' if was already absolute.
910

1011
## 2.0.2 - 2020-01-17
1112

lib/url.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ api.removeDotSegments = path => {
262262
output.push(next);
263263
}
264264

265-
// ensure output has leading /
266-
if(output.length > 0 && output[0] !== '') {
265+
// if path was absolute, ensure output has leading /
266+
if(path[0] === '/' && output.length > 0 && output[0] !== '') {
267267
output.unshift('');
268268
}
269269
if(output.length === 1 && output[0] === '') {

tests/test-common.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,6 @@ const TEST_TYPES = {
334334
/html-manifest.jsonld#tr020$/,
335335
/html-manifest.jsonld#tr021$/,
336336
/html-manifest.jsonld#tr022$/,
337-
// IRI resolution
338-
/toRdf-manifest.jsonld#t0130$/,
339-
/toRdf-manifest.jsonld#t0131$/,
340-
/toRdf-manifest.jsonld#t0132$/,
341337
// Invalid Statement
342338
/toRdf-manifest.jsonld#te075$/,
343339
/toRdf-manifest.jsonld#te111$/,

0 commit comments

Comments
 (0)