My backend server returns HTTP 405 back to Apigee 4.23 (OPDK) for a particular request. However, the backend fails to set the "ALLOW" header that the standard says that a 405 response should include.
Instead of fixing my backend (due to some constraints on touching a long running code base), I would like to handle this scenario in my proxy TargetEndpoint Response flow and add the ALLOW header. However, it looks like Apigee 4.23 (OPK) wouldn't let me do this and it sends the following response back to client:
HTTP/1.1 502 Bad Gateway
Content-Type: application/json
Content-Length: 139
{
"fault":{
"faultstring":"Received 405 Response without Allow Header",
"detail": {
"errorcode":"protocol.http.Response405WithoutAllowHeader"
}
}
}
I followed the documentation regarding setting the "success.codes" property on the TargetEndpoint:
<HTTPTargetConnection>
<Properties>
<Property name="success.codes">405</Property>
</Properties>
<URL>https://my.backend.url</URL>
</HTTPTargetConnection>
Still getting same error. How do I solve this ? Am using Apigee 4.23 (On Premises Deployment Kit)
HTTP.ignore.allow_header.for.405 is checked only at system level not for each proxy. Instead of treating 405 as success in the proxy, you can treat that as a fault and handle it in the fault flow.
Where in AssignMessage he can add Allow header and return the response to client.