Git Product home page Git Product logo

Comments (4)

h2non avatar h2non commented on September 22, 2024 1

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.

rahulmamgain avatar rahulmamgain commented on September 22, 2024 1

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.

danielsan avatar danielsan commented on September 22, 2024

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.

danielsan avatar danielsan commented on September 22, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.