Default to shouldFilterAllDispatcherTypes=true in XML

Closes gh-11970
This commit is contained in:
Marcus Da Coregio
2022-10-07 11:46:20 -03:00
parent 146d3269bc
commit 9fd195d419
7 changed files with 84 additions and 7 deletions

View File

@@ -85,8 +85,8 @@ class AuthorizationFilterParser implements BeanDefinitionParser {
BeanDefinitionBuilder filterBuilder = BeanDefinitionBuilder.rootBeanDefinition(AuthorizationFilter.class);
filterBuilder.getRawBeanDefinition().setSource(parserContext.extractSource(element));
filterBuilder.addConstructorArgReference(this.authorizationManagerRef);
if ("true".equals(element.getAttribute(ATT_FILTER_ALL_DISPATCHER_TYPES))) {
filterBuilder.addPropertyValue("shouldFilterAllDispatcherTypes", Boolean.TRUE);
if ("false".equals(element.getAttribute(ATT_FILTER_ALL_DISPATCHER_TYPES))) {
filterBuilder.addPropertyValue("shouldFilterAllDispatcherTypes", Boolean.FALSE);
}
BeanDefinition filter = filterBuilder
.addPropertyValue("securityContextHolderStrategy", this.securityContextHolderStrategy)

View File

@@ -386,7 +386,7 @@ http.attlist &=
## Corresponds to the observeOncePerRequest property of FilterSecurityInterceptor. Defaults to "false"
attribute once-per-request {xsd:boolean}?
http.attlist &=
## Corresponds to the shouldFilterAllDispatcherTypes property of AuthorizationFilter. Do not work when use-authorization-manager=false. Defaults to "false".
## Corresponds to the shouldFilterAllDispatcherTypes property of AuthorizationFilter. Do not work when use-authorization-manager=false. Defaults to "true".
attribute filter-all-dispatcher-types {xsd:boolean}?
http.attlist &=
## Prevents the jsessionid parameter from being added to rendered URLs. Defaults to "true" (rewriting is disabled).

View File

@@ -1366,7 +1366,7 @@
<xs:attribute name="filter-all-dispatcher-types" type="xs:boolean">
<xs:annotation>
<xs:documentation>Corresponds to the shouldFilterAllDispatcherTypes property of AuthorizationFilter. Do not
work when use-authorization-manager=false. Defaults to "false".
work when use-authorization-manager=false. Defaults to "true".
</xs:documentation>
</xs:annotation>
</xs:attribute>