Skip to content

Commit 2d5d2a8

Browse files
committed
By default exclude files from /WEB-INF from resources plugin processing
1 parent 76519be commit 2d5d2a8

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/cfg/ConfigurationHelper.groovy

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,16 @@ class ConfigurationHelper {
178178
if (isLocations(locations)) {
179179
mergeInLocations(config, (List)locations, resolver, classLoader)
180180
}
181+
182+
// Sets defaults for non-present settings
183+
initDefaultConfiguration(config)
184+
}
185+
186+
static void initDefaultConfiguration(ConfigObject config) {
187+
def resourcesConfig = config.grails.resources
188+
if(!resourcesConfig.adhoc.excludes) {
189+
resourcesConfig.adhoc.excludes = ['/WEB-INF/**']
190+
}
181191
}
182192

183193
private static getLocations(ConfigObject config) {

grails-resources/src/grails/grails-app/conf/Config.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ grails.mime.types = [ // the first one is the default format
3636

3737
// What URL patterns should be processed by the resources plugin
3838
grails.resources.adhoc.patterns = ['/images/*', '/css/*', '/js/*', '/plugins/*']
39+
grails.resources.adhoc.excludes = ['/WEB-INF/**']
3940

4041
// Legacy setting for codec used to encode data with ${}
4142
grails.views.default.codec = "html"

0 commit comments

Comments
 (0)