This is an automated email from the ASF dual-hosted git repository.

markt-asf pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new 9772864cad Add a note on security constraints and path matching
9772864cad is described below

commit 9772864cad36f1b8eecd80ecfd673385266d0887
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Nov 27 18:10:27 2026 +0000

    Add a note on security constraints and path matching
---
 webapps/docs/security-howto.xml | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/webapps/docs/security-howto.xml b/webapps/docs/security-howto.xml
index 92f999f86a..5b12867f42 100644
--- a/webapps/docs/security-howto.xml
+++ b/webapps/docs/security-howto.xml
@@ -608,6 +608,16 @@
     circumstances, correct application of the security constraint depends on 
the
     implementation of the Servlet. All servlets included with Tomcat will 
behave
     correctly in this scenario.</p>
+
+    <p>For the purposes of matching security constraints, <code>/path</code> 
and
+    <code>/path/</code> are different URLs. An exact match pattern such as
+    <code>/path</code> does not apply to a request for <code>/path/</code>.
+    A servlet mapped to <code>/path/*</code> will typically serve the same
+    resource, the directory or collection, for both <code>/path</code> and
+    <code>/path/</code>. A constraint that is intended to protect a directory 
or
+    the root of a servlet mapping should therefore use a prefix pattern such as
+    <code>/path/*</code>, which matches both forms and everything below them, 
or
+    should list both <code>/path</code> and <code>/path/</code>.</p>
   </section>
 
   <section name="Embedded Tomcat">


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to