-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If request method is HEAD don't allow writing body bytes. #47480
Comments
// Example Express.js route handler // If the request method is HEAD, only send headers, not body |
may be this solution will work , i would like to work on this issue |
I think the issue is asking to add the check inside Node JS API (not inside the request handler). The API used to write to the response body is this. |
What does this mean? Ignore the data, raise an exception, something else? It should already be ignoring it (and does, AFAICT.) |
Can I work on this issue? |
Raise an exception. |
That's a change that breaks longstanding behavior. I remember when Ryan introduced it, must've been around 2010, 2011. Should be very carefully tested with citgm and probably not added to v20.x (because LTS.) |
Hi, everyone. If you want to work on it, go for it. But no one gets to claim this issue or have it assigned to them or anything like that. You don't need to ask for permission to work on it. This is to avoid cookie-licking. |
Greetings, I tried to make a solution, do you think it is a good way, I would be very happy if you have comments ❤️ |
I know there's a PR in progress, but I wanted to give it a crack. If nothing else I am now more familiar with the codebase. My change would also effect responses with the status |
I think this was solved with #47732 if not reopen |
I've encountered this bug a few times, and it's always confusing and tricky to debug. It would be easier if node did not allow writing bytes to the response body when the request method is HEAD, i.e. throw.
The text was updated successfully, but these errors were encountered: