Skip to content
Myr

test(serve-static): fix the test (#5479)

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

* test(serve-static): fix the test * use app.get

authored by Yusuke Wada · committed by GitHub · parent 8b05c77 · Browse files · 1 file+1 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

1 file+1 added−1 removed

  • tests:+1 added−1 removed

1 file+1 added−1 removed

modified:src/middleware/serve-static/index.test.ts+1 added-1 removed
105 unmodified lines
106 })107108 it('Should not bypass authentication through a second decode', async () => {109 const app = new Hono()110 app.use('/static/admin/*', (c) => c.text('Unauthorized', 401))110 app.get('/static/admin/*', (c) => c.text('Unauthorized', 401))111 app.use('/static/*', baseServeStatic({ getContent }))112113 const protectedRes = await app.request('/static/admin/secret.txt')114 expect(protectedRes.status).toBe(401)
265 unmodified lines