Skip to content

Commit e2b1e68

Browse files
Kevin Wimmerfl4via
Kevin Wimmer
authored andcommitted
[UNDERTOW-1997] Corrected handling of security constraints with URL pattern '/'
1 parent e8ae803 commit e2b1e68

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

servlet/src/main/java/io/undertow/servlet/handlers/security/SecurityPathMatches.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,14 @@ public SecurityPathMatch getSecurityInfo(final String path, final String method)
139139
handleMatch(method, extensionMatch, currentMatch);
140140
return new SecurityPathMatch(currentMatch.type, mergeConstraints(currentMatch));
141141
}
142+
143+
// if nothing else, check for security info defined for URL pattern '/'
144+
match = exactPathRoleInformation.get("/");
145+
if (match != null) {
146+
handleMatch(method, match, currentMatch);
147+
return new SecurityPathMatch(currentMatch.type, mergeConstraints(currentMatch));
148+
}
149+
142150
return new SecurityPathMatch(currentMatch.type, mergeConstraints(currentMatch));
143151
}
144152

0 commit comments

Comments
 (0)