georchestra / georchestra-gateway

GNU General Public License v3.0
0 stars 6 forks source link

Preserve response headers when redirecting application error to gateway error pages #136

Closed groldan closed 1 month ago

groldan commented 1 month ago

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.


Fixes #128