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:
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:
but its still overridden with text/html when I use set-body option.