MCPcopy Index your code
hub / github.com/nodeSolidServer/node-solid-server / createFromLDPAndRequest

Method createFromLDPAndRequest

lib/acl-checker.mjs:264–281  ·  view source on GitHub ↗
(resource, ldp, req)

Source from the content-addressed store, hash-verified

262 }
263
264 static createFromLDPAndRequest (resource, ldp, req) {
265 const trustedOrigins = ldp.getTrustedOrigins(req)
266 return new ACLChecker(resource, {
267 agentOrigin: req.get('origin'),
268 // host: req.get('host'),
269 fetch: fetchLocalOrRemote(ldp.resourceMapper, ldp.serverUri),
270 fetchGraph: (uri, options) => {
271 // first try loading from local fs
272 return ldp.getGraph(uri, options.contentType)
273 // failing that, fetch remote graph
274 .catch(() => ldp.fetchGraph(uri, options))
275 },
276 suffix: ldp.suffixAcl,
277 strictOrigin: ldp.strictOrigin,
278 trustedOrigins,
279 slug: decodeURIComponent(req.headers.slug)
280 })
281 }
282}
283
284/**

Callers 1

allowFunction · 0.80

Calls 5

fetchLocalOrRemoteFunction · 0.85
getTrustedOriginsMethod · 0.80
getGraphMethod · 0.80
fetchGraphMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected