In Membrane, status codes can be modified using the groovy
element. For more in-depth scripting guidance, visit: Scripting.
<api port="2000">
<response>
<if test="statusCode == 401" language="SpEL">
<groovy>exc.getResponse().setStatusCode(404)</groovy>
</if>
</response>
<target url="http://localhost:2001" />
</api>
<api port="2001">
<return statusCode="401" />
</api>
groovy | Example | Documentation |
If | Example | Documentation |