Skip to content
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

stream: convert string to Buffer when calling unshift(<string>) #27194

Merged
merged 1 commit into from
Jun 2, 2019
Merged

stream: convert string to Buffer when calling unshift(<string>) #27194

merged 1 commit into from
Jun 2, 2019

Commits on Jun 2, 2019

  1. stream: convert string to Buffer when calling unshift(<string>)

    `readable.unshift` can take a string as an argument, but that
    string wasn't being converted to a Buffer, which caused a
    <TypeError: Argument must be a buffer> in some cases. Also if a
    string was passed, that string was coerced to utf8 encoding.
    
    A second optional argument `encoding` was added to `unshift` to
    fix the encoding issue.
    
    Fixes: #27192
    PR-URL: #27194
    Reviewed-By: Anna Henningsen <[email protected]>
    Reviewed-By: Matteo Collina <[email protected]>
    Reviewed-By: James M Snell <[email protected]>
    Reviewed-By: Rich Trott <[email protected]>
    marcosc90 authored and Trott committed Jun 2, 2019
    Configuration menu
    Copy the full SHA
    df339bc View commit details
    Browse the repository at this point in the history