-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Node 14.18 with http2: Uploading of files produces exception in deepmerge #274
Comments
Would you like to send a PR to fix this? This looks some bug you are the best equipped to fix. |
Strange, it should not fail. const deepmerge = require("deepmerge");
const http2 = require("http2");
const headers = {
[http2.sensitiveHeaders]: ["abc", "def"],
};
// success
deepmerge.all([{ headers: headers }, {}, {}]);
// success
deepmerge.all([{ headers: headers }, Object.create(null), {}]); |
So narrowed it down a bit. With http2 on, neither the |
This method is extends from I am thinking if it is the problem of node core. |
Agreed, will try to reproduce it with a sample node server then. Filed a bug here nodejs/node#40263 |
@mccare I have check the code and document, it is intentional behavior. nodejs/node#40263 (comment) We may need a ugly fix on our side or const busboyOptions = deepmerge.all([{ headers: Object.assign({}, req.headers) }, options || {}, opts || {}]) |
Thanks @climba03003 , I've implemented your suggestion and created a PR. Don't really know how to write a test for it though. |
Fixed with release 5.0.2 |
Prerequisites
Fastify version
3.21.6
Plugin version
5.0.1
Node.js version
14.18
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
cloud
Description
Since node 14.18 I get an exception when uploading a file. This is on Google Cloud Run with http2 enabled.
The stack trace shows:
I've verified this by creating a sample project pushing it to google cloud run and uploading a file. It could be related to nodejs/node#34145 (comment) where the user reports errors when iterating of the headers.
Steps to Reproduce
I've created a sample project here and deployed this version on cloud run.
Run for the Cloud run version
curl -v -F key1=value1 -F upload=@./package.json https://multipart-5knuaozepq-uc.a.run.app/upload
Expected Behavior
The server should just return "ok".
The text was updated successfully, but these errors were encountered: