Ignore trailing slash in Origin header

See gh-26892
This commit is contained in:
Rossen Stoyanchev
2021-05-07 14:56:56 +01:00
parent 582b94d50e
commit dddcc5e9ad
4 changed files with 34 additions and 9 deletions

View File

@@ -551,6 +551,9 @@ public class CorsConfiguration {
if (!StringUtils.hasText(requestOrigin)) {
return null;
}
if (requestOrigin.endsWith("/")) {
requestOrigin = requestOrigin.substring(0, requestOrigin.length() - 1);
}
if (!ObjectUtils.isEmpty(this.allowedOrigins)) {
if (this.allowedOrigins.contains(ALL)) {
validateAllowCredentials();