Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

response object doesn't set url or requestUrl if gzip encoding #240

Closed
jrgm opened this issue Nov 2, 2016 · 0 comments
Closed

response object doesn't set url or requestUrl if gzip encoding #240

jrgm opened this issue Nov 2, 2016 · 0 comments
Labels
bug Something does not work as it should

Comments

@jrgm
Copy link

jrgm commented Nov 2, 2016

Tested with got@6.6.0

var got = require('got')
var url = 'http://google.com/'
var encoding = process.argv[2]
var requestOptions = {
  headers: {
    'accept-encoding': encoding
  }
}
got(url, requestOptions)
  .then((res) => {
    console.log('res.url', res.url, typeof res.url, res.requestUrl)
  })

Output:

$ node test.js identity
res.url http://www.google.com/ string http://google.com/

$ node test.js gzip
res.url undefined undefined undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something does not work as it should
Projects
None yet
Development

No branches or pull requests

2 participants