-
Notifications
You must be signed in to change notification settings - Fork 853
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 checksum encoding, content-encoding header #4507
Fix checksum encoding, content-encoding header #4507
Conversation
|
||
@Override | ||
public String getChecksum() { | ||
return value; | ||
} |
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.
No longer needed (i added this default method), string repr is now configurable
|
||
/** | ||
* Return an encoded-string representation of the checksum. By default, this returns a String that is the lowercase, base16 | ||
* (hex) representation of the checksum. | ||
*/ | ||
default String getChecksum() { | ||
return toHex(getChecksumBytes()); | ||
} |
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.
No longer needed (i added this default method), string repr is now configurable
@@ -41,7 +42,7 @@ public void reset() { | |||
public Pair<String, List<String>> get() { | |||
return Pair.of( | |||
checksumName, | |||
Collections.singletonList(checksum.getChecksum()) | |||
Collections.singletonList(BinaryUtils.toBase64(checksum.getChecksumBytes())) |
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.
flexible checksum as trailer MUST be base64
if (request instanceof SdkHttpFullRequest) { | ||
return (SdkHttpFullRequest) request; | ||
} |
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.
Is this old code and what's the story behind the removal?
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.
Yes, sorry for not clarifying. This code is problematic, because in cases where the request IS an SdkHttpFullRequest (such as in the integ tests) and the payload is transformed in signing (chunk-encoding), the underlying payload never gets re-set to the transformed payload from signing.
…ia-checksums-and-encoding-fixes
SonarCloud Quality Gate failed. 9 Bugs 85.0% Coverage Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
ff8dbad
into
feature/master/sra-identity-auth
Motivation and Context
Modifications
Testing
Types of changes
Checklist
mvn install
succeedsscripts/new-change
script and following the instructions. Commit the new file created by the script in.changes/next-release
with your changes.License