Requests failing with 2.2.0 #75

Closed
cmelendez opened this Issue Nov 12, 2013 · 6 comments

Comments

Projects
None yet
2 participants

Hi,

Using 2.1.0-rc3 everything work as expected but with 2.2.0 all calls are returning a "StripeAPIError" with message "Invalid JSON received from the Stripe API"

mocha tests using 2.2.0:
․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․

85 passing (490ms)
1 failing

  1. Flows Allows me to retrieve default_currency:
    Invalid JSON received from the Stripe API

Cheers.

Contributor

padolsey commented Nov 12, 2013

Thanks for the report. Could you tell me what OS you're using and what version of node?

Sure.

  • node @v0.8.18
  • Ubuntu 12.0.4
Contributor

padolsey commented Nov 12, 2013

Thanks. I'm able to reproduce -- looking into it now.

@padolsey padolsey closed this in 562d7ca Nov 12, 2013

Contributor

padolsey commented Nov 12, 2013

So, it seems that we were sending the following User-Agent header via node's HTTPS module:

User-Agent: Stripe/v1 NodeBindings/2.2.0\n

The trailing newline seems to be dealt with (I'm assuming escaped or removed) in later versions of node. To be safe with previous versions (incl. 0.8) I've fixed it by explicitly removing any trailing newlines from our version string.

I just published 2.2.1 to npm. I hope this fixed it for you.

Contributor

padolsey commented Nov 12, 2013

And thanks once again for reporting this!

np. glad to be of help. cheers.

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