File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -243,8 +243,8 @@ class LDP {
243243 'PUT request requires a content-type via the Content-Type header' )
244244 }
245245
246- // reject resource with $ extension
247- const dollarExtensionRegex = / \$ \. [ ^ $ ] * $ /
246+ // reject resource with % encoded $ extension
247+ const dollarExtensionRegex = / % (?: 2 4 ) \. [ ^ % ( ? : 2 4 ) ] * $ / // / \$\.[^$]*$/
248248 if ( ( url . url || url ) . match ( dollarExtensionRegex ) ) {
249249 throw error ( 400 , 'Resource with a $.ext is not allowed by the server' )
250250 }
Original file line number Diff line number Diff line change @@ -535,15 +535,15 @@ describe('HTTP APIs', function () {
535535 . expect ( hasHeader ( 'acl' , 'baz.ttl' + suffixAcl ) )
536536 . expect ( 201 , done )
537537 } )
538- it ( 'should not create a resource with $.ext' , function ( done ) { // alain
539- server . put ( '/foo/bar/baz$ .ttl' )
538+ it ( 'should not create a resource with % encoded $.ext' , function ( done ) {
539+ server . put ( '/foo/bar/baz%24 .ttl' )
540540 . send ( putRequestBody )
541541 . set ( 'content-type' , 'text/turtle' )
542542 // .expect(hasHeader('describedBy', 'baz.ttl' + suffixMeta))
543543 // .expect(hasHeader('acl', 'baz.ttl' + suffixAcl))
544544 . expect ( 400 , done ) // 404
545545 } )
546- it ( 'should not create a resource with $.ext ' , function ( done ) { // alain
546+ it ( 'should create a resource without extension ' , function ( done ) {
547547 server . put ( '/foo/bar/baz' )
548548 . send ( putRequestBody )
549549 . set ( 'content-type' , 'text/turtle' )
You can’t perform that action at this time.
0 commit comments