diff options
Diffstat (limited to 'vendor/github.com/aws/aws-sdk-go/service/s3/sse.go')
-rw-r--r-- | vendor/github.com/aws/aws-sdk-go/service/s3/sse.go | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/sse.go b/vendor/github.com/aws/aws-sdk-go/service/s3/sse.go index 268ea2f..8010c4f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/sse.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/sse.go | |||
@@ -5,17 +5,27 @@ import ( | |||
5 | "encoding/base64" | 5 | "encoding/base64" |
6 | 6 | ||
7 | "github.com/aws/aws-sdk-go/aws/awserr" | 7 | "github.com/aws/aws-sdk-go/aws/awserr" |
8 | "github.com/aws/aws-sdk-go/aws/awsutil" | ||
9 | "github.com/aws/aws-sdk-go/aws/request" | 8 | "github.com/aws/aws-sdk-go/aws/request" |
10 | ) | 9 | ) |
11 | 10 | ||
12 | var errSSERequiresSSL = awserr.New("ConfigError", "cannot send SSE keys over HTTP.", nil) | 11 | var errSSERequiresSSL = awserr.New("ConfigError", "cannot send SSE keys over HTTP.", nil) |
13 | 12 | ||
14 | func validateSSERequiresSSL(r *request.Request) { | 13 | func validateSSERequiresSSL(r *request.Request) { |
15 | if r.HTTPRequest.URL.Scheme != "https" { | 14 | if r.HTTPRequest.URL.Scheme == "https" { |
16 | p, _ := awsutil.ValuesAtPath(r.Params, "SSECustomerKey||CopySourceSSECustomerKey") | 15 | return |
17 | if len(p) > 0 { | 16 | } |
17 | |||
18 | if iface, ok := r.Params.(sseCustomerKeyGetter); ok { | ||
19 | if len(iface.getSSECustomerKey()) > 0 { | ||
20 | r.Error = errSSERequiresSSL | ||
21 | return | ||
22 | } | ||
23 | } | ||
24 | |||
25 | if iface, ok := r.Params.(copySourceSSECustomerKeyGetter); ok { | ||
26 | if len(iface.getCopySourceSSECustomerKey()) > 0 { | ||
18 | r.Error = errSSERequiresSSL | 27 | r.Error = errSSERequiresSSL |
28 | return | ||
19 | } | 29 | } |
20 | } | 30 | } |
21 | } | 31 | } |