Skip to content
Myr

fix(serve-static): support Windows (#3477)

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

* wip * fixed the CI command * fixed the tests for passing on Windows * support Windows path when using `option.root` * bump the `bun` version

authored by Yusuke Wada · committed by GitHub · parent 530ab09 · Browse files · 3 files+27 added−4 removed
This commit

State

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

Diff stats

3 files+27 added−4 removed

  • tests:+2 added−2 removed
  • other:+25 added−2 removed

3 files+27 added−4 removed

modified:.github/workflows/ci.yml+11 added
100 unmodified lines
101 - uses: actions/upload-artifact@v4102 with:103 name: coverage-bun104 path: coverage/105106 bun-windows:107 name: 'Bun - Windows'108 runs-on: windows-latest109 steps:110 - uses: actions/checkout@v4111 - uses: oven-sh/setup-bun@v1112 with:113 bun-version: '1.1.39'114 - run: bun run test:bun115116 fastly:117 name: 'Fastly Compute'118 runs-on: ubuntu-latest119 steps:
155 unmodified lines
modified:runtime-tests/bun/index.test.tsx+2 added-2 removed
150 unmodified lines
151152 it('Should return 200 response - /static/helloworld', async () => {153 const res = await app.request('http://localhost/static/helloworld')154 expect(res.status).toBe(200)155 expect(await res.text()).toBe('Hi\n')155 expect(await res.text()).toMatch(/Hi\r?\n/)156 })157158 it('Should return 200 response - /static/hello.world', async () => {159 const res = await app.request('http://localhost/static/hello.world')160 expect(res.status).toBe(200)161 expect(await res.text()).toBe('Hi\n')161 expect(await res.text()).toMatch(/Hi\r?\n/)162 })163164 it('Should return 200 response - /static-absolute-root/plain.txt', async () => {165 const res = await app.request('http://localhost/static-absolute-root/plain.txt')
287 unmodified lines
modified:src/middleware/serve-static/index.ts+14 added-2 removed