Skip to content

Commit 91b8d88

Browse files
committed
test(rsc-mf): cover mixed-case connection token stripping
1 parent b52cb63 commit 91b8d88

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

tests/integration/rsc-mf/tests/proxyResponse.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,22 @@ describe('rsc-mf proxy response helper', () => {
6363
);
6464
expect(proxied.headers.get('etag')).toBe('"abc123"');
6565
});
66+
67+
it('normalizes mixed-case quoted connection tokens', () => {
68+
const upstream = new Response('ok', {
69+
status: 200,
70+
headers: {
71+
connection: '"X-Mixed-Hop-Header", Keep-Alive',
72+
'x-mixed-hop-header': 'remove-me',
73+
'Keep-Alive': 'timeout=5',
74+
'x-safe-header': 'preserve-me',
75+
},
76+
});
77+
78+
const proxied = createSafeProxyResponse(upstream);
79+
80+
expect(proxied.headers.get('x-mixed-hop-header')).toBeNull();
81+
expect(proxied.headers.get('keep-alive')).toBeNull();
82+
expect(proxied.headers.get('x-safe-header')).toBe('preserve-me');
83+
});
6684
});

0 commit comments

Comments
 (0)