aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go
diff options
context:
space:
mode:
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.go16
1 files changed, 5 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..9d4e762 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
import (
"bytes"
"encoding/base64"
- "encoding/json"
"fmt"
"io"
"io/ioutil"
@@ -16,6 +15,7 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/request"
+ "github.com/aws/aws-sdk-go/private/protocol"
)
// UnmarshalHandler is a named request handler for unmarshaling rest protocol requests
@@ -198,23 +198,17 @@ func unmarshalHeader(v reflect.Value, header string, tag reflect.StructTag) erro
}
v.Set(reflect.ValueOf(&f))
case *time.Time:
- t, err := time.Parse(RFC822, header)
+ t, err := time.Parse(time.RFC1123, header)
if err != nil {
return err
}
v.Set(reflect.ValueOf(&t))
case aws.JSONValue:
- b := []byte(header)
- var err error
+ escaping := protocol.NoEscape
if tag.Get("location") == "header" {
- b, err = base64.StdEncoding.DecodeString(header)
- if err != nil {
- return err
- }
+ escaping = protocol.Base64Escape
}
-
- m := aws.JSONValue{}
- err = json.Unmarshal(b, &m)
+ m, err := protocol.DecodeJSONValue(header, escaping)
if err != nil {
return err
}