Skip to content
Myr

Merge pull request from GHSA-3mpf-rcc7-5347

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 b38e40e · Browse files · 4 files+68 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

4 files+68 added−4 removed

  • tests:+66 added−0 removed
  • other:+2 added−4 removed

4 files+68 added−4 removed

modified:deno_dist/middleware/serve-static/index.ts+1 added-2 removed
modified:runtime_tests/deno/middleware.test.tsx+7 added
115 unmodified lines
116 res = await app.request('http://localhost/dot-static/plain.txt')117 assertEquals(res.status, 200)118 assertEquals(await res.text(), 'Deno!!')119 assertSpyCalls(onNotFound, 1)120121 res = await app.fetch({122 method: 'GET',123 url: 'http://localhost/static/%2e%2e/static/plain.txt',124 } as Request)125 assertEquals(res.status, 404)126 assertEquals(await res.text(), '404 Not Found')127})128129Deno.test('JWT Authentication middleware', async () => {130 const app = new Hono<{ Variables: { 'x-foo': string } }>()
25 unmodified lines
added:src/middleware/serve-static/index.test.ts+59 added
modified:src/middleware/serve-static/index.ts+1 added-2 removed
28 unmodified lines
29 if (c.finalized) {30 await next()31 return32 }33 const url = new URL(c.req.url)3335 let filename = options.path ?? decodeURI(url.pathname)34 let filename = options.path ?? decodeURI(c.req.path)35 filename = options.rewriteRequestPath ? options.rewriteRequestPath(filename) : filename36 const root = options.root3738 let path = getFilePath({
48 unmodified lines