1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-23 13:46:45 +02:00

feat: add test that verifies header precedence

This commit is contained in:
Fredrik Oseberg 2023-12-07 14:53:07 +01:00
parent d74929958d
commit fccbd18a04
No known key found for this signature in database
GPG Key ID: 816A423246CADD4E

View File

@ -57,3 +57,12 @@ test('should allow requests to /api/client/features with x-unleash-auth header',
.expect('Content-Type', /json/)
.expect(200);
});
test('should use x-unleash-auth if both headers are set', async () => {
await app.request
.get('/api/client/features')
.set('x-unleash-auth', clientToken.secret)
.set('authorization', 'gibberish')
.expect('Content-Type', /json/)
.expect(200);
});