Commit 37ff94b9 make the ApplicationError Gateway filter lose the original response headers when throwing a ResponseStatusException for the Gateway to show up the customized HTML error pages instead of the orignal (usually whitelabel) errors.
This patch makes it so that the ApplicationError filter runs only when text/html is accepted by the request, and the request method is idempotent (e.g. GET, HEAD, etc.).
Additionally, the original response headers are not lost, since the exception is thrown at ServerHttpResponseDecorator.beforeCommit(), and respecting the reactive chain.
Commit 37ff94b9 make the
ApplicationError
Gateway filter lose the original response headers when throwing aResponseStatusException
for the Gateway to show up the customized HTML error pages instead of the orignal (usually whitelabel) errors.This patch makes it so that the
ApplicationError
filter runs only whentext/html
is accepted by the request, and the request method is idempotent (e.g. GET, HEAD, etc.).Additionally, the original response headers are not lost, since the exception is thrown at
ServerHttpResponseDecorator.beforeCommit()
, and respecting the reactive chain.Fixes #128