Skip to content

Malformed response causing odd failure with no error #1527

@kjs3

Description

@kjs3

Describe the bug

  • Node.js version: 14.12.0 & 15.2.1
  • OS & version: MacOS Catalina (10.15.7) & Manjaro (rolling release, up to date)

I stumbled on a silent failure when parsing a bunch of podcast feeds. Specifically this one.

Chrome fails with a net::ERR_CONTENT_DECODING_FAILED error.
Curl and the Axios lib seem to handle the response just fine.

Actual behavior

Silent failure. The promise doesn't seem to resolve at all. I'm not sure what's going on within the Node loop.

Expected behavior

A ResponseError is probably the right behavior. The fact that some other libs can handle this confuses the issue though.

Code to reproduce

// got-test.js
const got = require('got')

main()

async function main() {
  const url = 'https://read.audioarchitect.co/feed/podcast'

  try {
    console.log('getting: ', url)
    const res = await got(url)
    console.log('never here: ', res)
  } catch (err) {
    console.error(err)
    console.log('never here either')
  }
}
node got-test.js

Checklist

  • I have read the documentation.
  • I have tried my code with the latest version of Node.js and Got.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething does not work as it shouldexternalThe issue related to an external projectnodejs bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions