Comments (6)
Sounds like it. Can you give me a code snippet that triggers this issue, and I'll fix the bug. Thanks!
from express-http-proxy.
@monkpow , @oyvindeh I'm hitting this issue too. I cannot tell you how to reproduce it -- express (or possibly helmet which I'm using) is loading up my req.headers by some default behavior... however, i do see where the problem in express-http-proxy is happening.
This may be a suitable fix for express-http-proxy index.js line ~83:
if (bodyEncoding(options)) {
var acceptEncodingHeader = reqOpt.headers[ 'Accept-Encoding'.toLowerCase() ];
if (acceptEncodingHeader) {
reqOpt.headers[ 'Accept-Encoding'.toLowerCase() ] = acceptEncodingHeader + ', ' + bodyEncoding(options);
} else {
reqOpt.headers[ 'Accept-Encoding' ] = bodyEncoding(options);
}
}
Edit: That is short-sighted; does not take into account unique values in this header. Various ways to do this; lodash would be my toolkit, but it does not look like you are including it.
from express-http-proxy.
@oyvindeh @btmurrell I'm tentative about fixing without being able to see the problem in action. If your hunch is right, you should be able to skip this chunk of code by adding
reqBodyEnconding: null
to your options.
from express-http-proxy.
I'm sorry, I haven't had time to write a snippet that triggers the issue. Hopefully, I'll be able to do so next week.
from express-http-proxy.
I have problems reproducing this outside of the environment where I get the error (and I cannot share the full code). But I can confirm that reqBodyEncoding: null
does indeed work around the issue.
from express-http-proxy.
@oyvindeh I did find a relevant bug in the code, which is patch here 861b620. This fix is in the most recent version (0.10.1) published to npm.
Let me know if you continue to have issues. Thanks for the report and clarifications so far.
from express-http-proxy.
Related Issues (20)
- memoizeHost option not working
- Can't update path with proxyReqPathResolver HOT 2
- Make the user request available in proxyErrorHandler
- proxyReqBodyDecorator value is not returned if parseReqBody == false
- DNS_PROBE_FINISHED_NXDOMAIN HOT 1
- ERR_HTTP_HEADERS_SENT when setting parseReqBody=true HOT 1
- form-urlencoded requests do not proxy correctly if content-type contains a semi-colon HOT 2
- Is this project still alive? Any alternatives? HOT 3
- "range" header is copied from container options even though it should be transitory
- Can I prevent express-http-proxy from unescaping string characters? HOT 1
- HTTP proxy HOT 2
- Can't use `proxy()` twice in an Express middleware stack HOT 11
- proxyReqOptDecorator not setting headers as described HOT 1
- How to use
- Major usability issue without `decorateRequest` HOT 1
- Tracking the response time HOT 1
- DeprecationWarning: OutgoingMessage.prototype._headers is deprecated *again* HOT 1
- SNI does not get set in outgoing connections
- Unable to change 'content-type' header of request HOT 2
- Unable to remove default charset from "content-type" response header
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from express-http-proxy.