This came up at ApacheCon a couple of weeks ago. I just took this knowledge for 
granted, as I have always accounted for it, but both Rich and Trawick were 
surprised. As I thought about it some more, it seems this may be a POLA 
violation. Thoughts? If we agree it should be fixed, I can make the bugz and 
make a patch.

Consider:

<Location "/slash/foo">
 ...
</Location>

vs.

<LocationMatch "^/slash/foo">
 ...
</LocationMatch>


These do not behave the same if multiple slashes are used. The leading slashes 
are always coalesced, so "^/..." is fine; however, any intermediate slashes are 
not. So, in order for the LocationMatch directive above to behave the same as 
the Location, it has to be specified as "^/slash/+foo". Like I said, I have 
always accounted for this in my regexps, but it doesn't seem "right". Should 
the URL be normalized before being passed to regex-matching directives, or is 
there a specific reason that is not done?

+-------------------+--------------+--------------+--------------+
| Path              |   Non-Regex  |    *Match,   |    *Match,   |
|                   |  Directive:  | RewriteRule: | RewriteRule: |
|                   |  /slash/foo  |  ^/slash/foo | ^/slash/+foo |
+-------------------+--------------+--------------+--------------+
| /slash/foo        |     Match    |     Match    |     Match    |
+-------------------+--------------+--------------+--------------+
| ////slash/foo     |     Match    |     Match    |     Match    |
+-------------------+--------------+--------------+--------------+
| /slash///foo      |     Match    |      XXX     |     Match    |
+-------------------+--------------+--------------+--------------+
| ////slash///foo// |     Match    |      XXX     |     Match    |
+-------------------+--------------+--------------+--------------+

Reply via email to