Places the CommonResponse struct at the *end* of all IAM responses. (#8537)
* Places the CommonResponse struct at the end of all IAM responses, rather than the start. * iam: fix error response request id layout * iam: add XML ordering regression test * iam: share request id generation --------- Co-authored-by: Aaron Segal <aaron.segal@rpsolutions.com> Co-authored-by: Chris Lu <chris.lu@gmail.com>
This commit is contained in:
@@ -162,6 +162,7 @@ func newIamErrorResponse(errCode string, errMsg string) iamErrorResponse {
|
||||
errorResp.Error.Type = "Sender"
|
||||
errorResp.Error.Code = &errCode
|
||||
errorResp.Error.Message = &errMsg
|
||||
errorResp.SetRequestId()
|
||||
return errorResp
|
||||
}
|
||||
|
||||
|
||||
@@ -1214,6 +1214,8 @@ func TestEmbeddedIamNotImplementedAction(t *testing.T) {
|
||||
apiRouter.ServeHTTP(rr, req)
|
||||
|
||||
assert.Equal(t, http.StatusNotImplemented, rr.Code)
|
||||
assert.Contains(t, rr.Body.String(), "<RequestId>")
|
||||
assert.NotContains(t, rr.Body.String(), "<ResponseMetadata>")
|
||||
}
|
||||
|
||||
// TestGetPolicyDocument tests parsing of policy documents
|
||||
|
||||
Reference in New Issue
Block a user