-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
The GetHead middleware is a nice convienent way to add HEAD support for all GET handlers, but it misses what to me are two vital features:
- A 405 response will not show HEAD in the Allow: header
The response body is included, despite HEAD semantics prohibiting a response body.EDIT: While the middleware doesn't handle this, I've learned the stdlib's http server does. So this is not as important as I thought--my tests withhttptest.ResponseRecorderwere in effect returning false positives as a result.
I've forked a copy of the GetHead middleware for my own app, and fixed these two oversights, but would love to contribute them upstream if they'd be accepted in a PR.
muety
Metadata
Metadata
Assignees
Labels
No labels