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

aws: Add config option to unmarshal API response header maps to normalized lower case map keys #3033

Merged
merged 12 commits into from
Jan 7, 2020

Conversation

skmcgrail
Copy link
Member

This adds support for normalizing AWS REST encoded/decoded headers. This resolves an outstanding customer ask #445 which documents the behavior of both Go net/http layer canonicalizing headers that are received in HTTP responses, in addition to the AWS SDK also enforcing that these returned headers be canonicalized as well. Enabling this flag will result in these types of headers being sent as lower-cased to AWS services, and responses targeting the header location will have the headers lower-cased during unmarshaling.

@skmcgrail skmcgrail requested a review from jasdel December 19, 2019 19:14
aws/config.go Outdated Show resolved Hide resolved
aws/awsutil/strings.go Outdated Show resolved Hide resolved
aws/awsutil/strings.go Outdated Show resolved Hide resolved
aws/awsutil/strings.go Outdated Show resolved Hide resolved
aws/awsutil/strings.go Outdated Show resolved Hide resolved
Copy link
Contributor

@skotambkar skotambkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, have minor suggestions.

@jasdel jasdel added the needs-review This issue or pull request needs review from a core team member. label Dec 31, 2019
Copy link
Contributor

@jasdel jasdel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should consider if normalized headers should apply to HTTP header marshal, not just unmarshal.

Also CHANGELOG_PENDING would be good for this, calling out fixes to related issues.

private/protocol/rest/build.go Outdated Show resolved Hide resolved
private/protocol/rest/unmarshal.go Show resolved Hide resolved
@jasdel jasdel removed the needs-review This issue or pull request needs review from a core team member. label Jan 2, 2020
private/protocol/restjson/build_test.go Outdated Show resolved Hide resolved
aws/config.go Outdated Show resolved Hide resolved
@skmcgrail skmcgrail requested a review from jasdel January 6, 2020 22:02
@jasdel
Copy link
Contributor

jasdel commented Jan 6, 2020

Would be good to add CHANGELOG_PENDING.md entry

@skmcgrail skmcgrail changed the title Add Support for Normalizing REST Location Headers aws: Add configuration option to unmarshal API response header maps to normalized lower case map keys Jan 7, 2020
@skmcgrail skmcgrail changed the title aws: Add configuration option to unmarshal API response header maps to normalized lower case map keys aws: Add config option to unmarshal API response header maps to normalized lower case map keys Jan 7, 2020
@skmcgrail skmcgrail merged commit 172af2f into aws:master Jan 7, 2020
@skmcgrail skmcgrail deleted the s3/headers branch January 7, 2020 18:40
aws-sdk-go-automation pushed a commit that referenced this pull request Jan 7, 2020
===

### Service Client Updates
* `service/AWSMigrationHub`: Updates service API, documentation, and paginators
* `service/codebuild`: Updates service API and documentation
  * Add encryption key override to StartBuild API in AWS CodeBuild.
* `service/xray`: Updates service documentation
  * Documentation updates for xray

### SDK Enhancements
* `aws`: Add configuration option enable the SDK to unmarshal API response header maps to normalized lower case map keys. ([#3033](#3033))
  * Setting `aws.Config.LowerCaseHeaderMaps` to `true` will result in S3's X-Amz-Meta prefixed header to be unmarshaled to lower case Metadata member's map keys.

### SDK Bugs
* `aws/ec2metadata` : Reduces request timeout for EC2Metadata client along with maximum number of retries ([#3066](#3066))
  * Reduces latency while fetching response from EC2Metadata client running in a container to around 3 seconds
  * Fixes [#2972](#2972)
aws-sdk-go-automation added a commit that referenced this pull request Jan 7, 2020
Release v1.27.2 (2020-01-07)
===

### Service Client Updates
* `service/AWSMigrationHub`: Updates service API, documentation, and paginators
* `service/codebuild`: Updates service API and documentation
  * Add encryption key override to StartBuild API in AWS CodeBuild.
* `service/xray`: Updates service documentation
  * Documentation updates for xray

### SDK Enhancements
* `aws`: Add configuration option enable the SDK to unmarshal API response header maps to normalized lower case map keys. ([#3033](#3033))
  * Setting `aws.Config.LowerCaseHeaderMaps` to `true` will result in S3's X-Amz-Meta prefixed header to be unmarshaled to lower case Metadata member's map keys.

### SDK Bugs
* `aws/ec2metadata` : Reduces request timeout for EC2Metadata client along with maximum number of retries ([#3066](#3066))
  * Reduces latency while fetching response from EC2Metadata client running in a container to around 3 seconds
  * Fixes [#2972](#2972)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants