Comments (4)
This should not be actually needed. Assuming you are using node.js, request package would transparently handle gzip decoding for you.
Be sure Eureka server is providing the valid HTTP hader gzip response.
from resilient.js.
Be sure Eureka server is oroviding the valid HTTP hader gzip response.
Eureka server is overriding the response header content-encoding.
that's what i rely on while parsing the response
httpRequest.on('response', function(response) {
switch (response.headers['content-encoding']) {
// or, just use zlib.createUnzip() to handle both cases
case 'gzip':
console.log("gzip");
response.pipe(zlib.createGunzip()).pipe(response);
break;
case 'deflate':
response.pipe(zlib.createInflate()).pipe(response);
break;
default:
break;
}
});
Assuming you are using node.js, request package would transparently handle gzip decoding for you.
That's why I also assumed, but either that's not happening, or i'm missing something very obvious.
from resilient.js.
I'm facing the same problem right now with Eureka.
I even attempted to gunzip the content within my middleware but the res.body is already a string when it gets to the middleware and there's no property/accessor to get the raw data sent from the remote server
from resilient.js.
@rahulmamgain, I'd just remove the console.log from that file so it is one less obstacle for this pull request to be accepted
from resilient.js.
Related Issues (20)
- How to handle rate limiting? HOT 15
- How to integrate resilient module with express framework HOT 2
- Use standard code style
- Support observer hooks
- Allow to override retries option on resilient#send and rest of methods. HOT 3
- Not balancing HOT 2
- Support Promises HOT 1
- Use ES6 syntax
- failed self-refresh call for discovery middleware servers breaks eeverything
- Global binary is throwing error
- resilient is trying to resolve servers during resolving servers in prev request HOT 5
- How to use querystring with GET?
- Typescript definitions? HOT 2
- Maximum simultaneous connections to a server. HOT 2
- Do you need a registry to use Discovery? HOT 2
- Fix failing build
- How to request binary files? HOT 1
- add the number of retries to the final response in case of custom faileure function
- Abandoned project HOT 1
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 resilient.js.