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

regression with request.defaults({}) since version 2.54.0 #1537

Closed
jmonster opened this issue Apr 10, 2015 · 1 comment · Fixed by #1540
Closed

regression with request.defaults({}) since version 2.54.0 #1537

jmonster opened this issue Apr 10, 2015 · 1 comment · Fixed by #1540

Comments

@jmonster
Copy link

I just upgraded from 2.53.0 to 2.55.0 and noticed some parts of my codebase have stopped working. I've looked at the Change Log and see that 2.55.0 specifically mentions fixes here -- but unfortunately I'm seeing issues regardless.

In particular, json: true is not being propagated and I end up with a string rather than an object in the body [probably nothing is, but that's the one that stands out]. Here is an example of how my code is laid out:

var Request = require('request').defaults({
  'gzip':       true,
  'json':       true
});
function _request(method, extraOpts) {
  var request = Request.defaults({
    foo: 'bar'
  });

  return Promise.promisify(request[method])('https://foo.bar', extraOpts);
}

As is, this fails to include the defaults specified above:

_request('get');

But if I explicitly specify it again things come back all JSONy:

_request('get', {json: true});

Request v0.53.0 works ✌️

@simov
Copy link
Member

simov commented Apr 11, 2015

@jmonster fixed here #1540 can you give it a try?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants