I'm dealing with a proprietary HTTP-server, which always responds with code 200 -- even when an error occurred. The indication of an error, if any, can only be found in the custom header, for example: MyApp-Status: SECURITY_EXCEPTION
(in successful requests that header contains OK
).
I'm putting Apache-based proxy in front of it and would like to fix this nonsense.
How would I change the very status of the response from the origin-specified (bogus) 200 to a more appropriate value depending on the origin's header MyApp-Status
?
I know, mod_headers modifies the headers of the response -- can it modify the status as well?
And mod_rewrite can set the status -- but can it be applied to the response?