Ensure local @CrossOrigin maxAge overrides global value
Prior to this commit, a method-level @CrossOrigin maxAge value did not
override a class-level @CrossOrigin maxAge value. This contradicts the
Javadoc for @CrossOrgin which states the following.
For those attributes where only a single value can be accepted such
as allowCredentials and maxAge, the local overrides the global
value.
This commit ensures that a method-level @CrossOrigin maxAge value
overrides a class-level @CrossOrigin maxAge value.
Closes gh-26619
This commit is contained in:
committed by
Sam Brannen
parent
5a11569790
commit
90de1ab6d1
@@ -341,7 +341,7 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi
|
||||
"or an empty string (\"\"): current value is [" + allowCredentials + "]");
|
||||
}
|
||||
|
||||
if (annotation.maxAge() >= 0 && config.getMaxAge() == null) {
|
||||
if (annotation.maxAge() >= 0) {
|
||||
config.setMaxAge(annotation.maxAge());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user