@@ -11,9 +11,11 @@ async function handler (req, res, next) {
1111 res . header ( 'MS-Author-Via' , 'SPARQL' )
1212
1313 const contentType = req . get ( 'content-type' )
14- if ( isAuxiliary ( req ) ) {
14+ // check for valid rdf content for auxiliary resource and /profile/card
15+ // in future we may check that /profile/card is a minimal valid WebID card
16+ if ( isAuxiliary ( req ) || req . originalUrl === '/profile/card' ) {
1517 if ( contentType === 'text/turtle' ) {
16- return bodyParser . text ( { type : ( ) => true } ) ( req , res , ( ) => putAuxiliary ( req , res , next ) )
18+ return bodyParser . text ( { type : ( ) => true } ) ( req , res , ( ) => putValidRdf ( req , res , next ) )
1719 } else return next ( new HTTPError ( 415 , 'RDF file contains invalid syntax' ) )
1820 }
1921 return putStream ( req , res , next )
@@ -37,7 +39,7 @@ async function putStream (req, res, next, stream = req) {
3739
3840// needed to avoid breaking access with bad acl
3941// or breaking containement triples for meta
40- function putAuxiliary ( req , res , next ) {
42+ function putValidRdf ( req , res , next ) {
4143 const ldp = req . app . locals . ldp
4244 const contentType = req . get ( 'content-type' )
4345 const requestUri = ldp . resourceMapper . getRequestUrl ( req )
0 commit comments