Skip to content

Commit e768e20

Browse files
committed
fix: correct defaults in spring-configuration-metadata.json and align urlmapping cache size
Addresses review feedback from matrei on #15426, reflecting the state after PR #15574 removed redundant defaults from generated application.yml files. - grails.urlmapping.cache.maxsize: change DEFAULT_MAX_WEIGHTED_CAPACITY in DefaultUrlMappingsHolder from 5000 to 1000 so the code default matches the documented value (the generated application.yml value removed in #15574). - grails.views.default.codec: correct defaultValue from 'none' to 'html' and clarify it is the fallback for the grails.views.gsp.codecs.* properties. - grails.views.gsp.htmlcodec: remove misleading 'xml' default and describe the actual behavior (when unset, the legacy HTML4-compatible encoder is used; setting it to 'xml' or 'xhtml' selects the XML-safe encoder). - grails.mime.disable.accept.header.userAgents: correct defaultValue from [] to ['Gecko', 'WebKit', 'Presto', 'Trident'] to match the regex baked into HttpServletResponseExtension. Assisted-by: sisyphus:claude-opus-4-7
1 parent c0bd6ec commit e768e20

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

grails-gsp/plugin/src/main/resources/META-INF/spring-configuration-metadata.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
{
2222
"name": "grails.views.default.codec",
2323
"type": "java.lang.String",
24-
"description": "The default encoding codec for GSP output. Set to `html` to reduce XSS risk. Options: `none`, `html`, `base64`.",
25-
"defaultValue": "none"
24+
"description": "Fallback default for `grails.views.gsp.codecs.expression`, `scriptlet`, `taglib` and `staticparts` when those are not set. Options: `none`, `html`, `base64`.",
25+
"defaultValue": "html"
2626
},
2727
{
2828
"name": "grails.views.gsp.encoding",
@@ -33,8 +33,7 @@
3333
{
3434
"name": "grails.views.gsp.htmlcodec",
3535
"type": "java.lang.String",
36-
"description": "The HTML codec for GSP output (xml or html).",
37-
"defaultValue": "xml"
36+
"description": "Selects the HTML escaping style for GSP output. When not set (or when the value does not start with `xml` or equal (ignoring case) `xhtml`), a legacy HTML4-compatible encoder is used. Set to `xml` or `xhtml` to use the XML-safe encoder."
3837
},
3938
{
4039
"name": "grails.views.gsp.codecs.expression",

grails-web-core/src/main/resources/META-INF/spring-configuration-metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@
199199
{
200200
"name": "grails.mime.disable.accept.header.userAgents",
201201
"type": "java.util.List<java.lang.String>",
202-
"description": "List of user agent substrings (e.g., Gecko, WebKit) for which Accept header processing is disabled.",
203-
"defaultValue": []
202+
"description": "List of user agent substrings (matched case-insensitively) for which Accept header processing is disabled.",
203+
"defaultValue": ["Gecko", "WebKit", "Presto", "Trident"]
204204
},
205205
{
206206
"name": "grails.mime.disable.accept.header.userAgentsXhr",

grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/DefaultUrlMappingsHolder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
public class DefaultUrlMappingsHolder implements UrlMappings {
7272

7373
private static final transient Log LOG = LogFactory.getLog(DefaultUrlMappingsHolder.class);
74-
private static final int DEFAULT_MAX_WEIGHTED_CAPACITY = 5000;
74+
private static final int DEFAULT_MAX_WEIGHTED_CAPACITY = 1000;
7575
public static final UrlMappingInfo[] EMPTY_RESULTS = new UrlMappingInfo[0];
7676

7777
private int maxWeightedCacheCapacity = DEFAULT_MAX_WEIGHTED_CAPACITY;

0 commit comments

Comments
 (0)