contributte / apitte

:wrench: An opinionated and enjoyable API framework based on Nette Framework. Supporting content negotiation, debugging, middlewares, attributes, annotations and loving openapi/swagger.
https://contributte.org/packages/contributte/apitte/
MIT License
61 stars 36 forks source link

ClientErrorException - how to modify headers? #95

Closed vylink closed 5 years ago

vylink commented 5 years ago

Hi,

Is it possible to modify response headers for ClientErrorException? Error Response is not delivered to the browser because of CORS :( Any advice?

Cheers

mabar commented 5 years ago

From #96 I see you use ResponseDecorator. Just implement IErrorDecorator, it should be enough. https://github.com/apitte/core/blob/master/src/Decorator/IErrorDecorator.php#L19

vylink commented 5 years ago

Many thanks. It works perfectly.