Skip to content
Myr

fix(serve-static): use application/octet-stream if the mime type is not detected (#3415)

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

authored by Taku Amano · committed by GitHub · parent 0edb243 · Browse files · 2 files+3 added−7 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+3 added−7 removed

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

2 files+3 added−7 removed

modified:src/middleware/serve-static/index.test.ts+1 added
141 unmodified lines
142143 expect(res.status).toBe(200)144 expect(res.headers.get('Content-Encoding')).toBe('br')145 expect(res.headers.get('Vary')).toBe('Accept-Encoding')146 expect(res.headers.get('Content-Type')).toBe('application/octet-stream')147 expect(await res.text()).toBe('Hello in static/hello.unknown.br')148 })149150 it('Should not return a pre-compressed response - /static/not-found.txt', async () => {
79 unmodified lines
modified:src/middleware/serve-static/index.ts+2 added-7 removed