Skip to content

Commit 72a3a69

Browse files
authored
Merge pull request #1738 from csarven/fix/acl-checker/origin-non-iri-error-handling
Handle error when Origin header value is not IRI
2 parents 958a6ef + e2c2d01 commit 72a3a69

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/acl-checker.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@ class ACLChecker {
2828
constructor (resource, options = {}) {
2929
this.resource = resource
3030
this.resourceUrl = new URL(resource)
31-
this.agentOrigin = options.strictOrigin && options.agentOrigin ? rdf.sym(options.agentOrigin) : null
31+
this.agentOrigin = null
32+
try {
33+
if (options.strictOrigin && options.agentOrigin) {
34+
this.agentOrigin = rdf.sym(options.agentOrigin)
35+
}
36+
} catch (e) {
37+
// noop
38+
}
3239
this.fetch = options.fetch
3340
this.fetchGraph = options.fetchGraph
3441
this.trustedOrigins = options.strictOrigin && options.trustedOrigins ? options.trustedOrigins.map(trustedOrigin => rdf.sym(trustedOrigin)) : null

0 commit comments

Comments
 (0)