diff --git a/ddapm_test_agent/agent.py b/ddapm_test_agent/agent.py index 1ca4fee9..b4b215e0 100644 --- a/ddapm_test_agent/agent.py +++ b/ddapm_test_agent/agent.py @@ -124,6 +124,10 @@ async def _forward_request(request_data, headers, full_agent_url): response_data = {} log.info("Response %r from agent:", response_data) return web.json_response(data=response_data) + elif "text/plain" in resp.content_type: + response_data = await resp.text() + log.info("Response %r from agent:", response_data) + return web.Response(text=response_data, content_type="text/plain") else: response_data = await resp.json() log.info("Response %r from agent:", response_data) diff --git a/releasenotes/notes/add-support-for-plain-text-responses-00d20bf7b335e75b.yaml b/releasenotes/notes/add-support-for-plain-text-responses-00d20bf7b335e75b.yaml new file mode 100644 index 00000000..7573014f --- /dev/null +++ b/releasenotes/notes/add-support-for-plain-text-responses-00d20bf7b335e75b.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Adds support for plain/text response content-types when forwarding requests.