mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-5: Take superclass into account when determining whether a method is a REST method.
This commit is contained in:
@@ -88,7 +88,26 @@ public class RESTMethodMatcher extends AbstractMatcher<Method> {
|
||||
|
||||
}
|
||||
|
||||
// The method is not an HTTP method
|
||||
// A method is also REST method if it overrides a REST method within
|
||||
// the superclass
|
||||
Class<?> superclass = method.getDeclaringClass().getSuperclass();
|
||||
if (superclass != null) {
|
||||
|
||||
// Recheck against identical method within superclass
|
||||
try {
|
||||
return isRESTMethod(superclass.getMethod(method.getName(),
|
||||
method.getParameterTypes()));
|
||||
}
|
||||
|
||||
// If there is no such method, then this method cannot possibly be
|
||||
// a REST method
|
||||
catch (NoSuchMethodException e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Lacking a superclass, the search stops here - it's not a REST method
|
||||
return false;
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user