Skip to content

Commit 99d4d1c

Browse files
kjetilkrubensworks
authored andcommitted
Fails the test when origin is invalid
1 parent 3c5c72b commit 99d4d1c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/integration/acl-oidc-test.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,14 +294,15 @@ describe('ACL with WebID+OIDC over HTTP', function () {
294294
done()
295295
})
296296
})
297-
it('user1 should be able to access test directory when origin is invalid',
297+
it('user1 should not be able to access test directory when origin is invalid',
298298
function (done) {
299299
var options = createOptions('/origin/test-folder/', 'user1')
300300
options.headers.origin = origin2
301301

302302
request.head(options, function (error, response, body) {
303303
assert.equal(error, null)
304-
assert.equal(response.statusCode, 200)
304+
assert.equal(response.statusCode, 403)
305+
assert.equal(response.statusMessage, 'Origin Unauthorized')
305306
done()
306307
})
307308
})
@@ -326,14 +327,15 @@ describe('ACL with WebID+OIDC over HTTP', function () {
326327
done()
327328
})
328329
})
329-
it('agent should be able to access test directory when origin is invalid',
330+
it('agent should not be able to access test directory when origin is invalid',
330331
function (done) {
331332
var options = createOptions('/origin/test-folder/')
332333
options.headers.origin = origin2
333334

334335
request.head(options, function (error, response, body) {
335336
assert.equal(error, null)
336-
assert.equal(response.statusCode, 200)
337+
assert.equal(response.statusCode, 403)
338+
assert.equal(response.statusMessage, 'Origin Unauthorized')
337339
done()
338340
})
339341
})

0 commit comments

Comments
 (0)