Skip to content

Commit 23a92eb

Browse files
authored
Merge pull request #1410 from bourgeoa/deleteDir
delete container with file.acl
2 parents 64e5e52 + 32e139a commit 23a92eb

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/ldp.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ class LDP {
426426
}
427427

428428
// Ensure the container is empty (we ignore .meta and .acl)
429-
if (list.some(file => file !== this.suffixMeta && file !== this.suffixAcl)) {
429+
if (list.some(file => !file.endsWith(this.suffixMeta) && !file.endsWith(this.suffixAcl))) {
430430
throw error(409, 'Container is not empty')
431431
}
432432

test/integration/http-test.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,8 @@ describe('HTTP APIs', function () {
512512
// Ensure all these are finished before running tests
513513
return Promise.all([
514514
rm('/false-file-48484848'),
515-
createTestContainer('delete-test-empty-container'),
515+
// createTestContainer('delete-test-empty-container'),
516+
createTestResource('/delete-test-empty-container/test.txt.acl'),
516517
createTestResource('/put-resource-1.ttl'),
517518
createTestResource('/delete-test-non-empty/test.ttl')
518519
])
@@ -534,7 +535,7 @@ describe('HTTP APIs', function () {
534535
.expect(409, done)
535536
})
536537

537-
it('should delete a new and empty container', function (done) {
538+
it('should delete a new and empty container - with file.acl', function (done) {
538539
server.delete('/delete-test-empty-container/')
539540
.end(() => {
540541
server.get('/delete-test-empty-container/')
@@ -547,6 +548,7 @@ describe('HTTP APIs', function () {
547548
// Clean up after DELETE API tests
548549
rm('/put-resource-1.ttl')
549550
rm('/delete-test-non-empty/')
551+
rm('/delete-test-empty-container/test.txt.acl')
550552
rm('/delete-test-empty-container/')
551553
})
552554
})

0 commit comments

Comments
 (0)