question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERR_CONTENT_DECODING_FAILED

See original GitHub issue

Hi everyone, i’m proxying a request with your awesome lib but in my chrome console in the network tab I receive this error “ERR_CONTENT_DECODING_FAILED”.

This is a simple snippet that show my operation

var http = require('http'),
request = require('request')

var httpServer = http.createServer(function (req, res) {

    var opt = {}
    opt.url = 'https://api.sendgrid.com/v3/campaigns'
    opt.auth = {}
    opt.auth.bearer = 'mytoken'
    req.pipe(request(opt)).pipe(res)

}).listen(4000, function () {
    console.log('Starting HTTP server on port: 4000');
});

This is the output of your lib with debug mode enabled:

REQUEST { url: 'https://api.sendgrid.com/v3/campaigns',
  auth: { bearer: 'myToken },
  callback: undefined }
REQUEST make request https://api.sendgrid.com/v3/campaigns
REQUEST onRequestResponse https://api.sendgrid.com/v3/campaigns 200 { server: 'nginx',
  date: 'Mon, 30 Nov 2015 10:47:58 GMT',
  'content-type': 'application/json; charset=utf-8',
  'transfer-encoding': 'chunked',
  connection: 'keep-alive',
  status: '200 OK',
  'x-request-id': '34953f9e-888f-4449-a53a-d371ff68fcfb',
  'x-xss-protection': '1; mode=block',
  'x-content-type-options': 'nosniff',
  'content-encoding': 'gzip',
  'strict-transport-security': 'max-age=31536000',
  'x-runtime': '0.111581',
  'x-ua-compatible': 'chrome=1',
  'cache-control': 'max-age=0, private, must-revalidate',
  'x-frame-options': 'SAMEORIGIN',
  'access-control-allow-methods': 'HEAD, GET, PUT, POST, DELETE, OPTIONS, PATCH',
  'access-control-max-age': '21600',
  'access-control-expose-headers': 'Link',
  'access-control-allow-origin': '*',
  'access-control-allow-headers': 'AUTHORIZATION, Content-Type, On-behalf-of, x-sg-elas-acl',
  'content-security-policy': 'default-src https://api.sendgrid.com; frame-src \'none\'; object-src \'none\'',
  'x-ratelimit-remaining': '598',
  'x-ratelimit-limit': '600',
  'x-ratelimit-reset': '1448880480',
  'powered-by': 'Mako' }
REQUEST finish init function https://api.sendgrid.com/v3/campaigns
REQUEST response end https://api.sendgrid.com/v3/campaigns 200 { server: 'nginx',
  date: 'Mon, 30 Nov 2015 10:47:58 GMT',
  'content-type': 'application/json; charset=utf-8',
  'transfer-encoding': 'chunked',
  connection: 'keep-alive',
  status: '200 OK',
  'x-request-id': '34953f9e-888f-4449-a53a-d371ff68fcfb',
  'x-xss-protection': '1; mode=block',
  'x-content-type-options': 'nosniff',
  'content-encoding': 'gzip',
  'strict-transport-security': 'max-age=31536000',
  'x-runtime': '0.111581',
  'x-ua-compatible': 'chrome=1',
  'cache-control': 'max-age=0, private, must-revalidate',
  'x-frame-options': 'SAMEORIGIN',
  'access-control-allow-methods': 'HEAD, GET, PUT, POST, DELETE, OPTIONS, PATCH',
  'access-control-max-age': '21600',
  'access-control-expose-headers': 'Link',
  'access-control-allow-origin': '*',
  'access-control-allow-headers': 'AUTHORIZATION, Content-Type, On-behalf-of, x-sg-elas-acl',
  'content-security-policy': 'default-src https://api.sendgrid.com; frame-src \'none\'; object-src \'none\'',
  'x-ratelimit-remaining': '598',
  'x-ratelimit-limit': '600',
  'x-ratelimit-reset': '1448880480',
  'powered-by': 'Mako' }

What you think about?

Mirko

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mirkodscommented, Feb 4, 2016

Ehi @mbernier has this error been fixed?

0reactions
stale[bot]commented, Nov 23, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix 'ERR_CONTENT_DECODING_FAILED' Error
What Causes the “ERR_CONTENT_DECODING_FAILED” Error? · Solution 1: Disabling G-Zip Encoding · Solution 2: Clearing Browser History and Cookies.
Read more >
Error 330 (net::ERR_CONTENT_DECODING_FAILED)
It happens when your HTTP request's headers claim that the content is gzip encoded, but it isn't. Turn off gzip encoding setting or...
Read more >
[FIXED] ERR_CONTENT_DECODING_FAILED Error Problem
How to Fix & Solve NET ERR_CONTENT_DECODING_FAILED Error Issue ; 1. Clear the Internet Browsing History – ; 2. Check the Internet Proxy...
Read more >
Top 4 Solutions to ERR_CONTENT_DECODING_FAILED on ...
Solution 1: Clear History and Cookies on the Browser · Solution 2: Change DNS Server Addresses · Solution 3: Turn off Windows Firewall...
Read more >
Accept-Encoding, Content-Encoding, and ERR CONTENT ...
Accept-Encoding, Content-Encoding, and ERR CONTENT DECODING FAILED. I wrote a online learning project for Manning Publications called Federation ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found