Description of Problem
The cloud request forwarder currently re-formats errors (non 200s HTTP responses) into its own construction, double-escaping the error coming from the service. The request forwarder should respond with the same response as the response from the service it forwards the request message to.
How reproducible
Always
Steps to Reproduce
- Send a request to a service that returns a non-200 HTTP response, for example: `/insights_cloud/api/vulnerability/v1/systems/00000000-0000-0000-0000-000000000000`
Actual Behavior
The response is re-formatted and double-escaped, like the following example:
{
"message": "Cloud request failed",
"error": "{\n \"errors\": [\n {\n \"detail\": \"inventory_id must exist and inventory_id must be visible to user\",\n \"status\": \"404\"\n }\n ]\n}\n",
"headers": {
},
"response": "{\n \"errors\": [\n {\n \"detail\": \"inventory_id must exist and inventory_id must be visible to user\",\n \"status\": \"404\"\n }\n ]\n}\n"
}
Expected Behavior
The request forwarder should return the response from the service as is.
Business Impact / Additional info
Frontend might not be able to properly process the error if doublewrapped.