8000 Handle error when Origin header value is not IRI by csarven · Pull Request #1738 · nodeSolidServer/node-solid-server · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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