Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to add custom response headers #312

Open
igorko opened this issue Nov 16, 2022 · 1 comment
Open

Possibility to add custom response headers #312

igorko opened this issue Nov 16, 2022 · 1 comment

Comments

@igorko
Copy link

igorko commented Nov 16, 2022

I was trying to add custom headers to assets responses. It was easy to do this with Grails 2 using resource mappers from grails-resources plugin. Now with latest Grails 4.1.2 and Grails 5. 2.5 it's not possible to Intercept resource responses. Spring Boot Filter and Grails Interceptor can only Intercept requests done by client, and all the rest assets requests, that are auto generated, where request initiator is page itself (loading assets, that are defined in gsp) are not intercepted. Using matchAll() in Grails Interceptor doesn't work too.
Tried on grails plugin version 3.4.7 with Java 8

@igorko
Copy link
Author

igorko commented Nov 17, 2022

I was able to attach filter to resources by setting order to Ordered.HIGHEST_PRECEDENCE. When using Ordered.LOWEST_PRECEDENCE order, filter is skipped by asset requests. Not sure if this is correct solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant