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.

* fix(cors): use `split` for Access-Control-Request-Headers * added a test

authored by Yusuke Wada · committed by GitHub · parent 51db313 · Browse files · 2 files+8 added−1 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+8 added−1 removed

  • tests:+7 added−0 removed
  • other:+1 added−1 removed

2 files+8 added−1 removed

modified:src/middleware/cors/index.test.ts+7 added
156 unmodified lines
157 'Content-Type',158 ])159 })160161 it('Preflight handles a large Access-Control-Request-Headers value', async () => {162 const req = new Request('https://localhost/api/abc', { method: 'OPTIONS' })163 req.headers.append('Access-Control-Request-Headers', 'x' + ' '.repeat(200000) + 'x')164 const res = await app.request(req)165 expect(res.status).toBe(204)166 })167168 it('Preflight with options', async () => {169 const req = new Request('https://localhost/api2/abc', {170 method: 'OPTIONS',171 headers: { origin: 'http://example.com' },
309 unmodified lines
modified:src/middleware/cors/index.ts+1 added-1 removed