Skip to content
This repository was archived by the owner on Jul 31, 2025. It is now read-only.

Commit 31e89e8

Browse files
author
v1rtl
committed
send proper HEAD (with headers and stuff)
1 parent 276e3f1 commit 31e89e8

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

app.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -306,23 +306,9 @@ export class App<
306306
type: 'mw',
307307
path: '/'
308308
},
309-
...matched.filter((x) => (x.method ? x.method === req.method : true))
309+
...matched.filter((x) => req.method === 'HEAD' || (x.method ? x.method === req.method : true))
310310
]
311311

312-
if (matched[0] != null) {
313-
mw.push({
314-
type: 'mw',
315-
handler: (req, res, next) => {
316-
if (req.method === 'HEAD') {
317-
res.statusCode = 204
318-
return res.end('')
319-
}
320-
next()
321-
},
322-
path: '/'
323-
})
324-
}
325-
326312
mw.push({
327313
handler: this.noMatchHandler,
328314
type: 'mw',

0 commit comments

Comments
 (0)