Send original data to requestDataProcessor if available.#182
Merged
michelle merged 1 commit intostripe:masterfrom Jun 30, 2015
Merged
Send original data to requestDataProcessor if available.#182michelle merged 1 commit intostripe:masterfrom
michelle merged 1 commit intostripe:masterfrom
Conversation
Contributor
|
I'm a bit confused as to what this fixes? Are you unable to upload a file? If so it would seem like https://github.com/stripe/stripe-node/blob/master/test/resources/FileUploads.spec.js#L58 should fail. |
Contributor
|
Though sure that line should be deleted |
Contributor
Author
|
https://github.com/stripe/stripe-node/blob/master/test/resources/FileUploads.spec.js#L5 uses a non binary file. If the test used a png or jpeg it would fail. |
Contributor
|
yeah, I reproduced it. I'd like to update that test, but that test doesn't reach into _request :/ Maybe I'll think of something when my brain is less melted |
Contributor
|
+1 running into this roadblock as well. Removed that line manually as a workaround, but would love to see this merged and published! |
Contributor
|
Nice catch! |
michelle
added a commit
that referenced
this pull request
Jun 30, 2015
Send original data to requestDataProcessor if available.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It is a problem for fileUploads since the utils#stringifyRequestData can't handle binary files. If the resource has a requestDataProcessor, it should send the original unprocessed data. Since the variable requestData is being declared twice, I assume someone forgot to erase this line.
With the line there, the following error happens on fileUploads (binary files):
/node_modules/stripe/node_modules/qs/lib/stringify.js:40
URIError: URI malformed
at encodeURIComponent (native)
at Object.internals.stringify (/Users/gabrielmarques/Desktop/CareLuLu/v2/CareLuLu/node_modules/stripe/node_modules/qs/lib/stringify.js:40:52)
at Object.internals.stringify (/node_modules/stripe/node_modules/qs/lib/stringify.js:56:46)
at Object.module.exports as stringify
at Object.module.exports.stringifyRequestData (/node_modules/stripe/lib/utils.js:37:15)
at Object.StripeResource._request (/node_modules/stripe/lib/StripeResource.js:169:29)
at Object.create (/node_modules/stripe/lib/StripeMethod.js:77:10)