Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The test is expecting an `AWSException` with code `"InvalidAction"` but the caught exception had code 404. It appears to be because the response body is XML but AWS didn't set the `Content-Type` header nor did it begin the response body with a clear indicator of the content type, so the body doesn't get properly parsed. To fix this, we can expand the set of things we look for to determine when to parse as XML. Previously we were only looking for `/xml` at the end of the content or `<?xml` at the beginning of the body, but the error response has neither, so here I've added a check for `<\w+ xmlns=` at the beginning of the body. This seems to be the expected format of an XML response when the `<?xml` line is absent. Documentation suggests that `<?xml` would only be absent in the case of an `ErrorResponse` but that the `Content-Type` header would be set to `text/xml`. Evidently not true in practice...
- Loading branch information