From 30b338892cf447f23016b88a3659c8f4a9566646 Mon Sep 17 00:00:00 2001 From: Tianyi Wang Date: Wed, 17 May 2023 13:04:27 -0400 Subject: [PATCH] modify changelog and remove deprecated setting usage --- .../09dc2a7906374b818a70a25a4b238623.json | 8 ----- CHANGELOG_PENDING.md | 4 +++ aws/config.go | 28 ++--------------- aws/config_test.go | 31 +++++++++---------- 4 files changed, 21 insertions(+), 50 deletions(-) delete mode 100644 .changelog/09dc2a7906374b818a70a25a4b238623.json diff --git a/.changelog/09dc2a7906374b818a70a25a4b238623.json b/.changelog/09dc2a7906374b818a70a25a4b238623.json deleted file mode 100644 index 37f9e76b424..00000000000 --- a/.changelog/09dc2a7906374b818a70a25a4b238623.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "09dc2a79-0637-4b81-8a70-a25a4b238623", - "type": "bugfix", - "description": "remove url path cleaning logic during http request serialization and deprecate its setting", - "modules": [ - "." - ] -} \ No newline at end of file diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 8a1927a39ca..26087d36c89 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -3,3 +3,7 @@ ### SDK Enhancements ### SDK Bugs +* `rest`: Remove unnecessary path normalization behavior. + * This behavior would incorrectly mutate request paths with URI-encoded characters, potentially resulting in misrouted requests. +* `config`: Deprecate `DisableRestProtocolURICleaning` config setting. + * This setting no longer has any effect. REST-protocol paths will now never be normalized after serialization. \ No newline at end of file diff --git a/aws/config.go b/aws/config.go index a64d720f45e..8a70f763b05 100644 --- a/aws/config.go +++ b/aws/config.go @@ -252,21 +252,8 @@ type Config struct { // and specify a Retryer instead. SleepDelay func(time.Duration) - // DisableRestProtocolURICleaning will not clean the URL path when making rest protocol requests. - // Will default to false. This would only be used for empty directory names in s3 requests. - // - // Example: - // sess := session.Must(session.NewSession(&aws.Config{ - // DisableRestProtocolURICleaning: aws.Bool(true), - // })) - // - // svc := s3.New(sess) - // out, err := svc.GetObject(&s3.GetObjectInput { - // Bucket: aws.String("bucketname"), - // Key: aws.String("//foo//bar//moo"), - // }) - // Deprecated: DisableRestProtocolURICleaning exists for historical compatibility of - // http request path cleaning setting and should not be used. + // Deprecated: This setting no longer has any effect. + // RESTful paths are no longer cleaned after request serialization. DisableRestProtocolURICleaning *bool // EnableEndpointDiscovery will allow for endpoint discovery on operations that @@ -499,13 +486,6 @@ func (c *Config) WithLowerCaseHeaderMaps(t bool) *Config { return c } -// WithDisableRestProtocolURICleaning sets a config DisableRestProtocolURICleaning value -// returning a Config pointer for chaining. -func (c *Config) WithDisableRestProtocolURICleaning(t bool) *Config { - c.DisableRestProtocolURICleaning = &t - return c -} - // MergeIn merges the passed in configs into the existing config object. func (c *Config) MergeIn(cfgs ...*Config) { for _, other := range cfgs { @@ -610,10 +590,6 @@ func mergeInConfig(dst *Config, other *Config) { dst.SleepDelay = other.SleepDelay } - if other.DisableRestProtocolURICleaning != nil { - dst.DisableRestProtocolURICleaning = other.DisableRestProtocolURICleaning - } - if other.EnforceShouldRetryCheck != nil { dst.EnforceShouldRetryCheck = other.EnforceShouldRetryCheck } diff --git a/aws/config_test.go b/aws/config_test.go index 461e514905c..8cbeecdc305 100644 --- a/aws/config_test.go +++ b/aws/config_test.go @@ -49,22 +49,21 @@ func TestCopyReturnsNewInstance(t *testing.T) { var mergeTestZeroValueConfig = Config{} var mergeTestConfig = Config{ - Credentials: testCredentials, - Endpoint: String("MergeTestEndpoint"), - Region: String("MERGE_TEST_AWS_REGION"), - DisableSSL: Bool(true), - HTTPClient: http.DefaultClient, - LogLevel: LogLevel(LogDebug), - Logger: NewDefaultLogger(), - MaxRetries: Int(10), - DisableParamValidation: Bool(true), - DisableComputeChecksums: Bool(true), - DisableEndpointHostPrefix: Bool(true), - EnableEndpointDiscovery: Bool(true), - EnforceShouldRetryCheck: Bool(true), - DisableRestProtocolURICleaning: Bool(true), - S3ForcePathStyle: Bool(true), - LowerCaseHeaderMaps: Bool(true), + Credentials: testCredentials, + Endpoint: String("MergeTestEndpoint"), + Region: String("MERGE_TEST_AWS_REGION"), + DisableSSL: Bool(true), + HTTPClient: http.DefaultClient, + LogLevel: LogLevel(LogDebug), + Logger: NewDefaultLogger(), + MaxRetries: Int(10), + DisableParamValidation: Bool(true), + DisableComputeChecksums: Bool(true), + DisableEndpointHostPrefix: Bool(true), + EnableEndpointDiscovery: Bool(true), + EnforceShouldRetryCheck: Bool(true), + S3ForcePathStyle: Bool(true), + LowerCaseHeaderMaps: Bool(true), } var mergeTests = []struct {