Merge branch '6.2.x'

This commit is contained in:
rstoyanchev
2025-02-07 13:23:14 +00:00
6 changed files with 98 additions and 25 deletions

View File

@@ -605,9 +605,6 @@ public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMap
HandlerMethod handlerMethod = createHandlerMethod(handler, method);
validateMethodMapping(handlerMethod, mapping);
// Enable method validation, if applicable
handlerMethod = handlerMethod.createWithValidateFlags();
Set<String> directPaths = AbstractHandlerMethodMapping.this.getDirectPaths(mapping);
for (String path : directPaths) {
this.pathLookup.add(path, mapping);
@@ -626,6 +623,10 @@ public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMap
this.corsLookup.put(handlerMethod, corsConfig);
}
// Init validation flags
// We do this strictly after using the original instance in the CORS lookups
handlerMethod = handlerMethod.createWithValidateFlags();
this.registry.put(mapping,
new MappingRegistration<>(mapping, handlerMethod, directPaths, name, corsConfig != null));
}