fix requester bug #727

Merged
merged 1 commit into from Dec 5, 2013

Projects

None yet

5 participants

@jchris
Contributor
jchris commented Dec 5, 2013

the ability to wrap the callback wasn't available for verbs aside from GET and DELETE, so I made it work for all verbs

Chris Anderson make request.defaults(options, requester) run the requester for all m…
…ethods

It wasn't working on PUT and POST before.
3c2cad1
@jhs
Contributor
jhs commented Dec 5, 2013

Just wanted to say, requests's .defaults() is (1) awesome, but (2) a bit unevenly supported. It was my inspiration to write defaultable.

https://github.com/nodejitsu/defaultable

@benatkin
Contributor
benatkin commented Dec 5, 2013

I read the update and the relevant parts of the code, and it looks good. I'm confident that it doesn't break anything. requester is however undocumented in the README. It would be nice for it to hint when it's useful, and I'm not sure. Any examples of use (real or hypothetical)? A failing test would also be nice.

@jchris
Contributor
jchris commented Dec 5, 2013

Here is a gist with the way I was using it when I noticed the bug:

https://gist.github.com/jchris/7801297

On Wed, Dec 4, 2013 at 11:30 PM, Ben Atkin (I accept patches by email.) <
notifications@github.com> wrote:

I read the update and the relevant parts of the code, and it looks good.
I'm confident that it doesn't break anything. requester is however
undocumented in the README. It would be nice for it to hint when it's
useful, and I'm not sure. Any examples of use (real or hypothetical)? A
failing test would also be nice.


Reply to this email directly or view it on GitHubhttps://github.com/mikeal/request/pull/727#issuecomment-29876880
.

Chris Anderson
http://jchrisa.net
http://www.couchbase.com

@mikeal
Member
mikeal commented Dec 5, 2013

was _requester already supported? if it's _ then it's private, and if we're opening it up for public use we should remove the _.

@jchris
Contributor
jchris commented Dec 5, 2013

It is supported as a the second argument to the defaults function, with the
_requester thing just some internal state that I think @polotek added
8cf019c

On Thu, Dec 5, 2013 at 8:17 AM, Mikeal Rogers notifications@github.comwrote:

was _requester already supported? if it's _ then it's private, and if
we're opening it up for public use we should remove the _.


Reply to this email directly or view it on GitHubhttps://github.com/mikeal/request/pull/727#issuecomment-29911449
.

Chris Anderson
http://jchrisa.net
http://www.couchbase.com

@mikeal mikeal merged commit 8e34457 into request:master Dec 5, 2013

1 check passed

default The Travis CI build passed
Details
@mikeal
Member
mikeal commented Dec 5, 2013

we'll want to revisit this use case for 3.0, i think there's a better way to enable this. until then, let's hold off on documenting it.

@unclespode

I spent so many hours last night trying to work out why my code had broken since doing an NPM update and this was the culprit. I was setting the defaults for jar:true and it still wasn't working...

Can't wait for this to make it's way over to NPM!

Member

when did that break?

When I was testing today, I think I had to go back to 2.2.3 to get my code to work again. But I know they also turned off jar:true as default a while back too - so it could have been that I came up to as well. I'm not sure is the short answer :P

Member

ok, i'll get a release out.

Member

released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment