-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
header field value cannot include CR/LF with Stripe #3660
Comments
We just ran into this problem as well. |
A better solution might would be to use
Changing this line to the following would repair the error and not require string replacement / newline stripping on the base64 output: 'Authorization' => 'Bearer ' + key.to_s, |
We are now seeing this issue popup as well on newer Stripe accounts. Any plans to push out a PR? |
Looks like this was already committed a few weeks ago: |
After updating my ActiveMerchant gem the new stripe accounts are now working. |
To provide a cleaner slate for the maintenance of the library, this PR/Issue is being labeled stale after 60 days without activity. It will be closed in 14 days unless you comment with an update regarding its applicability to the current build. Thank you! |
We recently started seeing "header field value cannot include CR/LF" when attempting to use Stripe.
This is the problematic line:
active_merchant/lib/active_merchant/billing/gateways/stripe.rb
Line 616 in 8b5d2ac
Apparently Stripe has started issuing secret keys (access tokens) that are much longer, and the plain
encode64
method will insert newlines in long strings.The fix is to switch to the
strict_encode64
method, which does not.This article helped us find the problem:
https://stackoverflow.com/questions/2620975/strange-n-in-base64-encoded-string-in-ruby
The text was updated successfully, but these errors were encountered: