csuhta opened a new issue, #13393:
URL: https://github.com/apache/trafficserver/issues/13393
We want to use ATS to protect a JSON API and image origin, we want all error
messages to be returned as JSON to the client. We are also using HRW4U. It
doesn't seem possible to configure ATS to return anything other than very
simple HTML responses
In Header Rewrite rules:
- Inside `REMAP {…}`, `http.status = 400` automatically changes the
`Content-Type` to `text/html`
- Inside `REMAP {…}`, `inbound.resp.body` can't be set to anything other
than basic text. It also doesn't seem possible to place quotes or newlines in
this string?
- Inside `REMAP {…}`, `inbound.resp.Content-Type` isn't supported, why can I
set the body but not this header?
- `set-body-from` is only supported inside `READ_RESPONSE {…}`, where it
replaces a potentially cached item
In addition, I cannot find any way to get `body_factory` to produce JSON
documents in places where ATS responds with its own errors, it's always
`text/html`
Am I completely missing something? Is there a way to send JSON when you want
to return a 4XX or 5XX error?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]