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

Verify: order of the AssetPipelineFilter inside the filterChain #226

Closed
davidkron opened this issue Sep 7, 2018 · 4 comments
Closed

Verify: order of the AssetPipelineFilter inside the filterChain #226

davidkron opened this issue Sep 7, 2018 · 4 comments

Comments

@davidkron
Copy link

Currently AssetPipelineFilter doesn't specify any order and gets placed after GrailsWebRequestFilter. In my opinion this is not correct and should be reevaluated as an asset request doesn't need a GrailsWebRequest and should therefore be placed before GrailsWebRequestFilter.

This has actually caused some side-effects in a production application of us:
One thing the GrailsWebRequestFilter does is managing the flash scope. As the AssetPipelineFilter comes after GrailsWebRequestFilter, every request to an asset file will clear the flash scope, which can produce some interesting race conditions.

Also this causes some minimal performance overhead by creating and destroying a GrailsWebRequest.

@davydotcom
Copy link
Contributor

davydotcom commented Sep 7, 2018 via email

@davidkron
Copy link
Author

I just tested with a new grails 3.3.8 project from http://start.grails.org.
Also we have some grails 3.1.x applications in production, where I discovered the behavior.

In both these versions the GrailsWebRequestFilter comes before AssetPipelineFilter.

@ivo-k
Copy link

ivo-k commented Mar 13, 2020

I could workaround the issue by adding the following to config in application.groovy
//FilterRegistrationBean.REQUEST_WRAPPER_FILTER_MAX_ORDER + 29 beans.assetPipelineFilter.order = 29

@davydotcom
Copy link
Contributor

set order to 0 in 3.2.3 coming out today

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

3 participants