header_rewrite set-body feature only supports the most basic of response bodies
set-body in ATS 9.2 doesn't support whitespace or newlines.
I was trying to use set-body to send a two line JSON response and couldn't get it to work. Trying to add "\n" or spaces for human readable formatting just resulted in a truncated set-body. The set-body setting also doesn't include a newline by default at the end of the body. If you do set-body "OK" there is no newline sent to the client.
can set-body reference a file on the local filesystem and serve that as a response body? Similar to what statichit plugin does, but with header_rewrite the operation can be performed when certain conditions are met.
Additionally, set-body seems to force Content-Type: text/html - I'd like to be able to specify something else like "application/json". I tried using:
cond %{SEND_RESPONSE_HDR_HOOK}
rm-header Content-Type
add-header Content-Type "application/json"
but its still overridden with text/html when I use set-body option.
Maybe related to #11472
This issue has been automatically marked as stale because it has not had recent activity. Marking it stale to flag it for further consideration by the community.