Skip to content

Commit 43f2992

Browse files
gkelloggdavidlehn
authored andcommitted
Better checking of absolute IRIs.
1 parent 9fef94e commit 43f2992

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
used after non-1.1 contexts.
1313
- `@vocab` can be relative in 1.0, resolved against either a previous `@vocab`,
1414
`@base` or document base.
15+
- Better checking of absolute IRIs.
1516

1617
### Removed
1718
- **BREAKING**: Remove callback API support. This includes removing support

lib/context.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,9 @@ function _expandIri(activeCtx, value, relativeTo, localCtx, defined, options) {
779779
}
780780

781781
// already absolute IRI
782-
return value;
782+
if(_isAbsoluteIri(value)) {
783+
return value;
784+
}
783785
}
784786

785787
// prepend vocab

lib/url.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ api.prependBase = (base, iri) => {
6666
return iri;
6767
}
6868
// already an absolute IRI
69-
if(iri.indexOf(':') !== -1) {
69+
if(api.isAbsolute(iri)) {
7070
return iri;
7171
}
7272

tests/test-common.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ const TEST_TYPES = {
111111
/expand-manifest.jsonld#t0102$/,
112112
// multiple graphs
113113
/expand-manifest.jsonld#t0103$/,
114-
// iris
115-
/expand-manifest.jsonld#t0109$/,
116114
// terms beginning with ':'
117115
/expand-manifest.jsonld#t0117$/,
118116
/expand-manifest.jsonld#t0118$/,

0 commit comments

Comments
 (0)