File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
java/org/apache/catalina/realm Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -688,9 +688,9 @@ public void backgroundProcess() {
688
688
689
689
// Check each defined security constraint
690
690
String uri = request .getRequestPathMB ().toString ();
691
- // Bug47080 - in rare cases this may be null
691
+ // Bug47080 - in rare cases this may be null or ""
692
692
// Mapper treats as '/' do the same to prevent NPE
693
- if (uri == null ) {
693
+ if (uri == null || uri . length () == 0 ) {
694
694
uri = "/" ;
695
695
}
696
696
@@ -722,7 +722,8 @@ public void backgroundProcess() {
722
722
}
723
723
724
724
for (int k =0 ; k < patterns .length ; k ++) {
725
- if (uri .equals (patterns [k ])) {
725
+ // Exact match including special case for the context root.
726
+ if (uri .equals (patterns [k ]) || patterns [k ].length () == 0 && uri .equals ("/" )) {
726
727
found = true ;
727
728
if (collection [j ].findMethod (method )) {
728
729
if (results == null ) {
Original file line number Diff line number Diff line change 82
82
rather than the user facing Principal object as Tomcat requires the
83
83
internal object to correctly process later authorization checks. (markt)
84
84
</fix>
85
+ <fix>
86
+ <bug>62067</bug>: Correctly apply security constraints mapped to the
87
+ context root using a URL pattern of <code>""</code>. (markt)
88
+ </fix>
85
89
</changelog>
86
90
</subsection>
87
91
<subsection name="Other">
You can’t perform that action at this time.
0 commit comments