Skip to content

Commit

Permalink
add plain text content type (#138)
Browse files Browse the repository at this point in the history
add plain/text content-type
  • Loading branch information
wconti27 authored Aug 10, 2023
1 parent b569eb1 commit f127b47
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ddapm_test_agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
features:
- |
Adds support for plain/text response content-types when forwarding requests.

0 comments on commit f127b47

Please sign in to comment.