<system-model xmlns="http://docs.openrepose.org/repose/system-model/v2.0">
...
<filters>
... (1)
<filter name="scripting"/> (2)
</filters>
...
</system-model>
This recipe explains how to configure Repose to replace the reason phrase on the status line of an HTTP response with the reason phrases recommended by RFC 2616.
Prior to Repose version 9.0, the reason phrase on the status line of the response from the origin service was not copied to the response returned by Repose. Following this recipe will, in effect, replicate that behavior by normalizing the reason phrase.
system-model.cfg.xml
Update your System Model to include the Scripting Filter.
<system-model xmlns="http://docs.openrepose.org/repose/system-model/v2.0">
...
<filters>
... (1)
<filter name="scripting"/> (2)
</filters>
...
</system-model>
1 | The existing filter chain. |
2 | The new filter scripting filter added to the filter chain. This filter can be placed at the end of the filter chain to only normalize origin service reason phrases or at the beginning of the filter chain to normalize all reason phrases (including those set by Repose). |
scripting.cfg.xml
Filter ConfigurationAdd the Scripting Filter configuration file to your configuration directory.
<?xml version="1.0" encoding="UTF-8"?>
<scripting xmlns="http://docs.openrepose.org/repose/scripting/v1.0"
language="groovy">
filterChain.doFilter(request, response)
response.uncommit()
response.setStatus(response.getStatus)
</scripting>