Open
Conversation
quaelin
reviewed
Mar 8, 2019
lib/protocol/V2.js
Outdated
|
|
||
| [ data, footer, nonce ] = (utils.parse('utf-8'))(data, footer, nonce); | ||
| if (this._binary) { | ||
| [ data ] = (utils.parse('utf-8'))(data); |
Member
There was a problem hiding this comment.
Should this not be "binary" rather than "utf-8"?
Author
There was a problem hiding this comment.
Good catch, I have no idea how the test was passing.
quaelin
approved these changes
Mar 8, 2019
Member
quaelin
left a comment
There was a problem hiding this comment.
Seems good... but as getting character encoding conversions right can be tricky in practice, have you tested that this actually works with tokens generated by our Ruby library?
Author
|
I did test it by manually editing the module in node_modules when I was tracking down the problem. I should test it with this approach though. |
Author
|
Tested with this branch now and it verifies and unzips the ruby token successfully. 🕺 |
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.
By default the module expects the token message to be UTF-8. That causes a problem in our current usage where the token content is gzipped during creation. After
toString('utf-8')is called on the message buffer there is no way to get the original binary back. The goal of this PR is to add the ability to specify that the content is binary without breaking any backward compatibility.@change/platform @change/fe-platform