diff options
author | Alex Pilon <apilon@hashicorp.com> | 2019-02-22 18:24:37 -0500 |
---|---|---|
committer | Alex Pilon <apilon@hashicorp.com> | 2019-02-22 18:24:37 -0500 |
commit | 15c0b25d011f37e7c20aeca9eaf461f78285b8d9 (patch) | |
tree | 255c250a5c9d4801c74092d33b7337d8c14438ff /vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go | |
parent | 07971ca38143c5faf951d152fba370ddcbe26ad5 (diff) | |
download | terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.tar.gz terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.tar.zst terraform-provider-statuscake-15c0b25d011f37e7c20aeca9eaf461f78285b8d9.zip |
deps: github.com/hashicorp/terraform@sdk-v0.11-with-go-modules
Updated via: go get github.com/hashicorp/terraform@sdk-v0.11-with-go-modules and go mod tidy
Diffstat (limited to 'vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go')
-rw-r--r-- | vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go index 7a779ee..33fd53b 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go | |||
@@ -3,7 +3,6 @@ package rest | |||
3 | import ( | 3 | import ( |
4 | "bytes" | 4 | "bytes" |
5 | "encoding/base64" | 5 | "encoding/base64" |
6 | "encoding/json" | ||
7 | "fmt" | 6 | "fmt" |
8 | "io" | 7 | "io" |
9 | "io/ioutil" | 8 | "io/ioutil" |
@@ -16,6 +15,7 @@ import ( | |||
16 | "github.com/aws/aws-sdk-go/aws" | 15 | "github.com/aws/aws-sdk-go/aws" |
17 | "github.com/aws/aws-sdk-go/aws/awserr" | 16 | "github.com/aws/aws-sdk-go/aws/awserr" |
18 | "github.com/aws/aws-sdk-go/aws/request" | 17 | "github.com/aws/aws-sdk-go/aws/request" |
18 | "github.com/aws/aws-sdk-go/private/protocol" | ||
19 | ) | 19 | ) |
20 | 20 | ||
21 | // UnmarshalHandler is a named request handler for unmarshaling rest protocol requests | 21 | // UnmarshalHandler is a named request handler for unmarshaling rest protocol requests |
@@ -198,23 +198,21 @@ func unmarshalHeader(v reflect.Value, header string, tag reflect.StructTag) erro | |||
198 | } | 198 | } |
199 | v.Set(reflect.ValueOf(&f)) | 199 | v.Set(reflect.ValueOf(&f)) |
200 | case *time.Time: | 200 | case *time.Time: |
201 | t, err := time.Parse(RFC822, header) | 201 | format := tag.Get("timestampFormat") |
202 | if len(format) == 0 { | ||
203 | format = protocol.RFC822TimeFormatName | ||
204 | } | ||
205 | t, err := protocol.ParseTime(format, header) | ||
202 | if err != nil { | 206 | if err != nil { |
203 | return err | 207 | return err |
204 | } | 208 | } |
205 | v.Set(reflect.ValueOf(&t)) | 209 | v.Set(reflect.ValueOf(&t)) |
206 | case aws.JSONValue: | 210 | case aws.JSONValue: |
207 | b := []byte(header) | 211 | escaping := protocol.NoEscape |
208 | var err error | ||
209 | if tag.Get("location") == "header" { | 212 | if tag.Get("location") == "header" { |
210 | b, err = base64.StdEncoding.DecodeString(header) | 213 | escaping = protocol.Base64Escape |
211 | if err != nil { | ||
212 | return err | ||
213 | } | ||
214 | } | 214 | } |
215 | 215 | m, err := protocol.DecodeJSONValue(header, escaping) | |
216 | m := aws.JSONValue{} | ||
217 | err = json.Unmarshal(b, &m) | ||
218 | if err != nil { | 216 | if err != nil { |
219 | return err | 217 | return err |
220 | } | 218 | } |