Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-2119

Allow case insensitivity for path() path-prefix() and path-suffix()

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • Predicate Language
    • None

      Using a case insensitive resource manager or servlet mappings makes it nearly impossible to use path(), path-prefix() or path-prefix() for any sort of security.

      path-prefix( /admin ) -> response-code( 401 )

      as an attacker can simply upper case a letter in the URL such as /Admin and now the predicate no longer matches.  This requires me to use regex() predicates for nearly anything.  Both path() and path-prefix() use use the same `PathMatcher` class.  path-suffix() just uses String.endsWith().  

      It should be fairly easy to adopt these mechanisms to have a case-insensitive version.  The question then becomes if the predicate syntax should change to this:

      path-prefix( path="/admin", case-sensitive=false );
      

       or...

      path-prefix-nocase( /admin )
      

      I realize there is precedent for the first option in the regex() predicate, but I'm a fan of the second option as it's easier to type and easier to read.  

            rhn-cservice-bbaranow Bartosz Baranowski
            bdw429s Brad Wood
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: