Skip to content

Commit

Permalink
modify changelog and remove deprecated setting usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Tianyi Wang committed May 17, 2023
1 parent 16b4c86 commit 30b3388
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 50 deletions.
8 changes: 0 additions & 8 deletions .changelog/09dc2a7906374b818a70a25a4b238623.json

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
28 changes: 2 additions & 26 deletions aws/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
Expand Down
31 changes: 15 additions & 16 deletions aws/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 30b3388

Please sign in to comment.