From 1affa97dccfae4772f8d1877e45f8529bbb14ded Mon Sep 17 00:00:00 2001 From: Roman <11049859+RomanSerikov@users.noreply.github.com> Date: Tue, 7 Dec 2021 03:38:43 +0300 Subject: [PATCH] private/protocol/rest: Fix return error in location errors (#4138) Fixes #4120 by returning error from unmarshalHeaderMap method. --- private/protocol/rest/unmarshal.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/private/protocol/rest/unmarshal.go b/private/protocol/rest/unmarshal.go index 92f8b4d9a48..c26fbfa5aed 100644 --- a/private/protocol/rest/unmarshal.go +++ b/private/protocol/rest/unmarshal.go @@ -140,7 +140,7 @@ func unmarshalLocationElements(resp *http.Response, v reflect.Value, lowerCaseHe prefix := field.Tag.Get("locationName") err := unmarshalHeaderMap(m, resp.Header, prefix, lowerCaseHeaderMaps) if err != nil { - awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err) + return awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err) } } }