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

Function putValidRdf

lib/handlers/put.mjs:86–96  ·  view source on GitHub ↗
(req, res, next)

Source from the content-addressed store, hash-verified

84// needed to avoid breaking access with bad acl
85// or breaking containement triples for meta
86function putValidRdf (req, res, next) {
87 const ldp = req.app.locals.ldp
88 const contentType = req.get('content-type')
89 const requestUri = ldp.resourceMapper.getRequestUrl(req)
90
91 if (ldp.isValidRdf(req.body, requestUri, contentType)) {
92 const stream = stringToStream(req.body)
93 return putStream(req, res, next, stream)
94 }
95 next(new HTTPError(400, 'RDF file contains invalid syntax'))
96}
97
98function isAuxiliary (req) {
99 const originalUrlParts = req.originalUrl.split('.')

Callers 1

handlerFunction · 0.85

Calls 5

stringToStreamFunction · 0.90
putStreamFunction · 0.85
getRequestUrlMethod · 0.80
isValidRdfMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected