Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/handlers/allow.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function allow (mode) {
},
suffix: ldp.suffixAcl,
strictOrigin: ldp.strictOrigin,
trustedOrigins: ldp.trustedOrigins
trustedOrigins: [ldp.resourceMapper.resolveUrl(req.hostname)].concat(ldp.trustedOrigins)
})

// Ensure the user has the required permission
Expand Down
20 changes: 19 additions & 1 deletion test/integration/authentication-oidc-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ describe('Authentication API (OIDC)', () => {
})
})

// Our origin isn't trusted by default
// Our origin is trusted by default
describe('with that cookie and our origin', () => {
let response
before(done => {
Expand All @@ -225,6 +225,24 @@ describe('Authentication API (OIDC)', () => {
})
})

it('should return a 200', () => {
expect(response).to.have.property('status', 200)
})
})

// Another origin isn't trusted by default
describe('with that cookie and our origin', () => {
let response
before(done => {
alice.get('/')
.set('Cookie', cookie)
.set('Origin', 'https://some.other.domain.com')
.end((err, res) => {
response = res
done(err)
})
})

it('should return a 403', () => {
expect(response).to.have.property('status', 403)
})
Expand Down