Skip to content

Commit ff5799e

Browse files
committed
updates
1 parent 235759b commit ff5799e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/ldp.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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 = /%(?:24)\.[^%(?:24)]*$/ // /\$\.[^$]*$/
248248
if ((url.url || url).match(dollarExtensionRegex)) {
249249
throw error(400, 'Resource with a $.ext is not allowed by the server')
250250
}

test/integration/http-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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')

0 commit comments

Comments
 (0)