-
Notifications
You must be signed in to change notification settings - Fork 452
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
fix: Base64 decoding to discard newline characters #1941
Conversation
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.
LGTM, with just one very small thing.
@@ -26,6 +26,10 @@ | |||
*/ | |||
@Deprecated | |||
public class Base64 { | |||
// Special decoders that discards the new line character so that the behavior matches what | |||
// we had with Apache Commmons Codec's decodeBase64. |
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.
I think it would be worth commenting on what the 64 means. (It doesn't mean very much, since it's only used for encoding and we don't do that.)
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.
Added explanation of the 2nd parameter of the withSeparator method.
google-http-client/src/main/java/com/google/api/client/util/Base64.java
Outdated
Show resolved
Hide resolved
google-http-client/src/test/java/com/google/api/client/util/Base64Test.java
Outdated
Show resolved
Hide resolved
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.
Sorry for misunderstanding in my previous comment.
Using b/274482271#comment3 by @eamonnmcmanus
trim()
method that was also added for the compatibility.