Skip to content

Commit

Permalink
Merge pull request #1742 from nodeSolidServer/csarvenfix/acl-checker/…
Browse files Browse the repository at this point in the history
…origin-non-iri-error-handling

Csarvenfix/acl checker/origin non iri error handling
  • Loading branch information
bourgeoa authored Dec 17, 2023
2 parents acf53e5 + 72a3a69 commit 7be97cd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/acl-checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,14 @@ class ACLChecker {
constructor (resource, options = {}) {
this.resource = resource
this.resourceUrl = new URL(resource)
this.agentOrigin = options.strictOrigin && options.agentOrigin ? rdf.sym(options.agentOrigin) : null
this.agentOrigin = null
try {
if (options.strictOrigin && options.agentOrigin) {
this.agentOrigin = rdf.sym(options.agentOrigin)
}
} catch (e) {
// noop
}
this.fetch = options.fetch
this.fetchGraph = options.fetchGraph
this.trustedOrigins = options.strictOrigin && options.trustedOrigins ? options.trustedOrigins.map(trustedOrigin => rdf.sym(trustedOrigin)) : null
Expand Down

0 comments on commit 7be97cd

Please sign in to comment.