Skip to content

Commit a337fdb

Browse files
committed
Communicate allowed origins through the server (#26)
1 parent 7d4267d commit a337fdb

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/acl-checker.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class ACLChecker {
1616
this.fetch = options.fetch
1717
this.fetchGraph = options.fetchGraph
1818
this.strictOrigin = options.strictOrigin
19+
this.originsAllowed = options.originsAllowed
1920
this.suffix = options.suffix || DEFAULT_ACL_SUFFIX
2021
}
2122

@@ -112,6 +113,7 @@ class ACLChecker {
112113
origin: this.origin,
113114
rdf: rdf,
114115
strictOrigin: this.strictOrigin,
116+
originsAllowed: this.originsAllowed,
115117
isAcl: uri => this.isAcl(uri),
116118
aclUrlFor: uri => this.aclUrlFor(uri)
117119
}

lib/handlers/allow.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ function allow (mode) {
4747
.catch(() => ldp.fetchGraph(uri, options))
4848
},
4949
suffix: ldp.suffixAcl,
50-
strictOrigin: ldp.strictOrigin
50+
strictOrigin: ldp.strictOrigin,
51+
originsAllowed: ldp.originsAllowed
5152
})
5253

5354
// Ensure the user has the required permission

0 commit comments

Comments
 (0)