From 401d5f2ea463e40f5cb8c91be995a8db11cab5a3 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Mon, 4 Sep 2023 16:25:23 +0200 Subject: [PATCH 1/2] Handle error when Origin header value is not IRI --- lib/acl-checker.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/acl-checker.js b/lib/acl-checker.js index 577c0ef42..00a56aeae 100644 --- a/lib/acl-checker.js +++ b/lib/acl-checker.js @@ -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 From e2c2d01a27f96ca8d5f97ffed8a808a30aab51e6 Mon Sep 17 00:00:00 2001 From: Alain Bourgeois Date: Fri, 20 Oct 2023 17:20:40 +0200 Subject: [PATCH 2/2] Update acl-checker.js