Skip to content

Commit 32e139a

Browse files
committed
delete container with file.acl
1 parent 6b890f2 commit 32e139a

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
@@ -410,7 +410,7 @@ class LDP {
410410
}
411411

412412
// Ensure the container is empty (we ignore .meta and .acl)
413-
if (list.some(file => file !== this.suffixMeta && file !== this.suffixAcl)) {
413+
if (list.some(file => !file.endsWith(this.suffixMeta) && !file.endsWith(this.suffixAcl))) {
414414
throw error(409, 'Container is not empty')
415415
}
416416

test/integration/http-test.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,8 @@ describe('HTTP APIs', function () {
506506
// Ensure all these are finished before running tests
507507
return Promise.all([
508508
rm('/false-file-48484848'),
509-
createTestContainer('delete-test-empty-container'),
509+
// createTestContainer('delete-test-empty-container'),
510+
createTestResource('/delete-test-empty-container/test.txt.acl'),
510511
createTestResource('/put-resource-1.ttl'),
511512
createTestResource('/delete-test-non-empty/test.ttl')
512513
])
@@ -528,7 +529,7 @@ describe('HTTP APIs', function () {
528529
.expect(409, done)
529530
})
530531

531-
it('should delete a new and empty container', function (done) {
532+
it('should delete a new and empty container - with file.acl', function (done) {
532533
server.delete('/delete-test-empty-container/')
533534
.end(() => {
534535
server.get('/delete-test-empty-container/')
@@ -541,6 +542,7 @@ describe('HTTP APIs', function () {
541542
// Clean up after DELETE API tests
542543
rm('/put-resource-1.ttl')
543544
rm('/delete-test-non-empty/')
545+
rm('/delete-test-empty-container/test.txt.acl')
544546
rm('/delete-test-empty-container/')
545547
})
546548
})

0 commit comments

Comments
 (0)