Skip to content

Commit a2c1b77

Browse files
committed
test(http-interceptors): add case insensitive header check
1 parent 5aced01 commit a2c1b77

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/unit/interceptors/http.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,21 @@ describe('HTTP Interceptors', () => {
3030
// Assert
3131
expect(request.headers.get('Content-Type')).toBe('text/plain');
3232
});
33+
34+
it('should perform case insensitive checks on headers', async () => {
35+
// Arrange
36+
const request = new Request('https://example.com', {
37+
headers: { 'content-type': 'text/plain' },
38+
});
39+
40+
const interceptor = HttpInterceptors.setDefaultHeaders();
41+
42+
// Act
43+
await interceptor({ request });
44+
45+
// Assert
46+
expect(request.headers.get('Content-Type')).toBe('text/plain');
47+
});
3348
});
3449

3550
describe('transformErrors', () => {

0 commit comments

Comments
 (0)