string_decoder: Add 'end' method, do base64 properly #4119

Closed
wants to merge 1 commit into
from

4 participants

@isaacs

Add an 'end' method to the StringDecoder class which just dumps the rest of whatever it's got. Also, use this to make setEncoding('base64') work properly.

@bnoordhuis
Node.js Foundation member

FTR, I reviewed 0d17997 which is slightly older. Some nits, otherwise LGTM.

@isaacs isaacs closed this Oct 13, 2012
@dotnetCarpenter

I'm not a 100% sure but this seems to fix a bug in 0.8.14 where images encoded in Base64 and piped to output via a buffer would contain extraneous "=" chars and break the image. Upgrading to 0.9.3 fixed it for me.

See https://bugzilla.mozilla.org/show_bug.cgi?id=813139 for a discussion about the issue.

If this pull request is the fix then could it be applied to the 0.8.x stack?

@bnoordhuis
Node.js Foundation member

If this pull request is the fix then could it be applied to the 0.8.x stack?

If you mean "can I cherry-pick it to my local copy" the answer is probably "yes", there's a good chance it applies cleanly.

If the question is "will you put out a new v0.8 release with this fix" the answer is "no". The v0.8 branch is for bug fixes only, it has a frozen API.

(EDIT: Which doesn't imply that this is not a bug fix - just that it won't be back-ported because of the API change.)

@koichik

@dotnetCarpenter - In v0.8, setEncoding('base64') is not supported (see API docs).

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