Skip to content
Myr

Merge commit from fork

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Yusuke Wada · committed by GitHub · parent f70e2c3 · Browse files · 2 files+32 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+32 added−0 removed

  • tests:+20 added−0 removed
  • other:+12 added−0 removed

2 files+32 added−0 removed

modified:src/helper/proxy/index.test.ts+20 added
48 unmodified lines
49 'Transfer-Encoding': 'chunked',50 },51 })52 )53 } else if (req.url === 'https://example.com/connection-listed') {54 return Promise.resolve(55 new Response('ok', {56 headers: {57 Connection: 'x-connection-scoped, bad name',58 'X-Connection-Scoped': 'should not be forwarded',59 'X-Normal': 'kept',60 },61 })62 )63 } else if (req.url === 'https://example.com/set-cookie') {64 return Promise.resolve(65 new Response('ok', {66 headers: {
175 unmodified lines
242243 expect(res.headers.get('Transfer-Encoding')).toBeNull()244 })245246 it('remove response headers listed in the Connection header', async () => {247 const app = new Hono()248 app.get('/proxy/:path', (c) => proxy(`https://example.com/${c.req.param('path')}`))249 const res = await app.request('/proxy/connection-listed')250 expect(res.status).toBe(200)251 expect(res.headers.get('Connection')).toBeNull()252 expect(res.headers.get('X-Connection-Scoped')).toBeNull()253 expect(res.headers.get('X-Normal')).toBe('kept')254 })255256 it('modify header', async () => {257 const app = new Hono()258 app.get('/proxy/:path', (c) =>259 proxy(`https://example.com/${c.req.param('path')}`, {
97 unmodified lines
modified:src/helper/proxy/index.ts+12 added