-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
[v14.x backport] buffer: add base64url encoding option #39702
Conversation
There was also this doc fix fd02dac you could pick |
fd02dac is already in v14.x |
enum encoding {ASCII, UTF8, BASE64, UCS2, BINARY, HEX, BUFFER, LATIN1 = BINARY}; | ||
// BASE64URL is not currently exposed to the JavaScript side. | ||
enum encoding { | ||
ASCII, | ||
UTF8, | ||
BASE64, | ||
UCS2, | ||
BINARY, | ||
HEX, | ||
BUFFER, | ||
BASE64URL, | ||
LATIN1 = BINARY | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@addaleax IIUC, this is OK ABI-wise because the new element doesn't change the other values of the enum? But ParseEncoding
can now return this new value and programs that don't expect it would break? Can we do something about it (other than not backporting the feature)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@targos Yes, exactly, it’s ABI-compatible but not API-compatible, strictly speaking, and I don’t think we could really do something about it other than modifying ParseEncoding()
to not return that value when called from userland code.
The problem with that is that, since we fall back to a default encoding in that case, ParseEncoding(isolate, "base64url") == LATIN1
, which would seem like a bug.
I’d probably just leave this as-is, it’s unlikely to cause problems for a lot of addons (and even then only when somebody actually uses base64url
with it).
78bb65e
to
73e6781
Compare
PR-URL: nodejs#36952 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Backport parts of nodejs@dae283d
Landed in a343956 |
Backport parts of nodejs@dae283d PR-URL: nodejs#36952 Backport-PR-URL: nodejs#39702 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
The fixup commit is a partial application of the changes from dae283d that are needed for this to work.