-
Notifications
You must be signed in to change notification settings - Fork 80
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
feat: Add support for flexible checksums on streaming payloads #1329
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.
I have fixed several issues in this feature, both in this PR and in smithy-lang/smithy-swift#659.
Some refactoring & performance improvements are required, but will be done in a separate PR.
// shouldSignHeaders block was not provided, then include all headers other | ||
// than Transfer-Encoding. | ||
let modifiedShouldSignHeader = { (name: String) in | ||
guard name.lowercased(with: Locale(identifier: "en_US_POSIX")) != "transfer-encoding" else { return false } |
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.
what's the reason for checking en_US_POSIX locale?
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.
If you don't specify the locale for the date & string operations that are locale-dependent, then you get the locale that the user sets as default on their device. And that may not result in lowercasing like you expected.
(I have had this happen with datetime stamps in the past, not with lowercasing, but the same risk is present)
Issue #
#1319
Description of changes
Also:
Transfer-Encoding
header from AWS signature calculations, since it is sometimes modified superficially by the HTTP client immediately before sending a HTTP request, causing a signature mismatch.New/existing dependencies impact assessment, if applicable
No new dependencies were added to this change.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.