-
-
Notifications
You must be signed in to change notification settings - Fork 34.8k
Open
Description
Version
v20.11.1
Platform
In the docs linked here - https://nodejs.org/api/all.html#all_http2_headers-object:~:text=In%20HTTP/2%2C%20the%20request%20path%2C, we see this statement:
Care must be taken not to inadvertently modify these special headers or errors may occur. For instance, removing all headers from the request will cause errors to occur:
And also in the source code setter is missing for headers
https://github.com/nodejs/node/blob/1523d66a695ad1d1743e84966ff11859cc3dfd54/lib/internal/http2/compat.js#L310
But we are able to update the headers using Object.assign.
Should that be allowed?
Subsystem
No response
What steps will reproduce the bug?
- Use context.req.headers = newRandomObject. This will throw an error.
- Use Object.assign(context.req.headers, someObject). This will not throw an error.
How often does it reproduce? Is there a required condition?
Everytime
What is the expected behavior? Why is that the expected behavior?
For it to consistently throw an error in both cases
What do you see instead?
No error
Additional information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels