Skip to content

Commit

Permalink
fix for GPRESOURCES-262: do extra check only when resourceLocatorEnab…
Browse files Browse the repository at this point in the history
…led is disabled
  • Loading branch information
lhotari committed Jan 13, 2015
1 parent 7c2df5e commit d11c37c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class ResourceProcessor implements InitializingBean, ServletContextAware {
return false
}
// only allow urls that end with the uri given as input
if(!urlAsString.endsWith(uri)) {
if(!resourceLocatorEnabled && !urlAsString.endsWith(uri)) {
return false
}
return canProcessLegacyResource(uri)
Expand Down

1 comment on commit d11c37c

@lhotari
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When grailsResourceLocator is used in development mode (resourceLocatorEnabled=true by default in dev.mode) , the check failed and therefore I disabled it.
Example of debugging grails-website project:

urlAsString: file:/Users/lari/workspace-grails-projects/grails-website/target/plugins/jquery-ui-1.8.24/web-app/jquery-ui/themes/ui-lightness/jquery-ui-1.8.24.custom.css
uri: /plugins/jquery-ui-1.8.24/jquery-ui/themes/ui-lightness/jquery-ui-1.8.24.custom.css

urlAsString never ends with uri in this case.

Please sign in to comment.