mirror of
https://github.com/apache/struts.git
synced 2026-08-11 01:27:14 +00:00
Adds more strict DMI logic
This commit is contained in:
+6
-1
@@ -846,7 +846,8 @@ public class XmlConfigurationProvider implements ConfigurationProvider {
|
||||
NodeList allowedMethodsEls = element.getElementsByTagName("allowed-methods");
|
||||
|
||||
Set<String> allowedMethods;
|
||||
if (packageContext.isStrictMethodInvocation()) {
|
||||
if (allowedMethodsEls.getLength() > 0) {
|
||||
// user defined 'allowed-methods' so used them whatever Strict DMI was enabled or not
|
||||
allowedMethods = packageContext.getGlobalAllowedMethods();
|
||||
|
||||
if (allowedMethodsEls.getLength() > 0) {
|
||||
@@ -859,7 +860,11 @@ public class XmlConfigurationProvider implements ConfigurationProvider {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (packageContext.isStrictMethodInvocation()) {
|
||||
// user enabled Strict DMI but didn't defined action specific 'allowed-methods' so we use 'global-allowed-methods' only
|
||||
allowedMethods = packageContext.getGlobalAllowedMethods();
|
||||
} else {
|
||||
// Strict DMI is disabled to any method can be called
|
||||
allowedMethods = new HashSet<>();
|
||||
allowedMethods.add(ActionConfig.REGEX_WILDCARD);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user