Skip to content

Decoding Gzipped Content #148

Open
Open
@rahulmamgain

Description

@rahulmamgain

While working with the latest eureka server. I'm running the following docker image docker image

The setup is as following

The basic code is below

var resilientClient= Resilient({
    discovery: {
        servers: ['http://localhost:8080/'],
        headers: {
            Accept: 'application/json'
        }
    }
});
var servers = [
    'http://localhost:8080/'
];
resilientClient.use(eurekaMiddleware({
    'path': "eureka/v2/apps",
    'serviceName': "MY_REST_API"
}));
resilientClient.discoveryServers(servers);
  • The problem I face is when the response is Gzipped from the eureka server hence can not be parsed directly as xml.

  • I did try different options but none worked for me, As a final solution I had to edit http.js

https://github.com/resilient-http/resilient.js/pull/147/files

this seems to work well.

My two questions are

  1. Is there any way to achieve this without this code change.
  2. If not, is http js the right place to put in this hook.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions