mirror of
https://github.com/apache/struts.git
synced 2026-08-11 01:27:14 +00:00
WW-5352 Map-like type support
This commit is contained in:
+9
-1
@@ -400,7 +400,15 @@ public class ParametersInterceptor extends MethodFilterInterceptor {
|
||||
if (!(genericType instanceof ParameterizedType)) {
|
||||
return;
|
||||
}
|
||||
Type paramType = ((ParameterizedType) genericType).getActualTypeArguments()[0];
|
||||
Type[] paramTypes = ((ParameterizedType) genericType).getActualTypeArguments();
|
||||
allowlistParamType(paramTypes[0]);
|
||||
if (paramTypes.length > 1) {
|
||||
// Probably useful for Map or Map-like classes
|
||||
allowlistParamType(paramTypes[1]);
|
||||
}
|
||||
}
|
||||
|
||||
protected void allowlistParamType(Type paramType) {
|
||||
if (paramType instanceof Class) {
|
||||
threadAllowlist.allowClass((Class<?>) paramType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user