FIX: Don't break on invalid headers#1395
FIX: Don't break on invalid headers#1395asbermudez wants to merge 3 commits intohttp-party:masterfrom asbermudez:bugfix/warn-on-invalid-header
Conversation
|
The build seems to be breaking because of something I haven't changed... 🤷♂ |
|
Thanks @asbermudez This looks reasonable enough to me. The fail in CI is only during the Node 6 pipeline...but it's past due that Node 6 support is killed off, in my opinion. |
|
To add some more info, this error specially happens with proxied requests to servers "protected" with Incapsula. |
|
@jsmylnycky I've added the changes of https://github.com/http-party/node-http-proxy/pull/1397/files to verify it does build properly. |
Codecov Report
@@ Coverage Diff @@
## master #1395 +/- ##
==========================================
- Coverage 92.35% 92.08% -0.27%
==========================================
Files 6 6
Lines 314 316 +2
==========================================
+ Hits 290 291 +1
- Misses 24 25 +1
Continue to review full report at Codecov.
|
|
Hello, when this PR will be merged? As we are having the same exact issue and this PR addresses it. The issue is related to the response from |
|
Hello! Do we have any plans to merge it? We are having a problem with security scanner, it's sending malformed headers and we are getting a storm of exceptions. It's should work more graceful. |
|
Hello! Do you have any plans to merge it? We have the same problems |
|
we've also run into this problem, and we are now applying the fix from this PR via patch-package. would be good to see this merged sometime, thank you 🙏 |
|
@jsmylnycky I was running into this issue and would wish a flag to disable this exception for invalid headers |
Apologies but I'm no longer involved in this project. You'll need to reach out to the current maintainers. |
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1395 +/- ##
==========================================
- Coverage 92.35% 92.08% -0.27%
==========================================
Files 6 6
Lines 314 316 +2
==========================================
+ Hits 290 291 +1
- Misses 24 25 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
RIP |
catch ERR_INVALID_CHAR errors from res.setHeader() when upstream servers return headers with invalid characters (e.g. control chars), instead of crashing the proxy. Invalid headers are silently skipped. ref: http-party/node-http-proxy#1395
…ly (#106) catch ERR_INVALID_CHAR errors from res.setHeader() when upstream servers return headers with invalid characters (e.g. control chars), instead of crashing the proxy. Invalid headers are silently skipped. ref: http-party/node-http-proxy#1395
|
This issue has been fixed in unjs/httpxy#106. |
Have found that in some scenarios the proxied server does return invalid characters in the headers, like here:
nodejs/node#21509
In the current version the proxy does break when a invalid character is found with a
[ERR_INVALID_CHAR]: Invalid character in header contentThis PR aims to avoid the total crash of the application and instead show a warning in the console and process all what can be processed.