nacho       2002/09/01 13:32:07

  Modified:    jk/native2/common jk_uriMap.c
  Log:
  Filter prefix matches to allow only exact
  matches with an optional path_info or query string at end.
  
  Fixes Bug#12141
  
  Revision  Changes    Path
  1.38      +15 -7     jakarta-tomcat-connectors/jk/native2/common/jk_uriMap.c
  
  Index: jk_uriMap.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriMap.c,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- jk_uriMap.c       15 Aug 2002 11:24:54 -0000      1.37
  +++ jk_uriMap.c       1 Sep 2002 20:32:07 -0000       1.38
  @@ -635,13 +635,21 @@
       /* Then prefix match */
       match=jk2_uriMap_prefixMap( env, uriMap, ctxEnv->prefixMatch, uri, uriLen, 
reverse );
       if( match != NULL ) {
  -        /* restore */
  -        if( url_rewrite ) *url_rewrite=origChar;
  -        if( uriMap->mbean->debug > 0 )
  -            env->l->jkLog(env, env->l, JK_LOG_DEBUG,
  -                          "uriMap.mapUri() prefix match %s %s\n",
  -                          uri, match->workerName ); 
  -        return match;
  +        char c=uri[match->prefix_len];
  +        /* XXX Filter prefix matches to allow only exact 
  +               matches with an optional path_info or query string at end.
  +               Fixes Bugzilla#12141, needs review..
  +        */
  +        if (( uriLen > match->prefix_len && ( c=='/' || c=='?' ) ) ||
  +              uriLen == match->prefix_len ) {
  +            /* restore */
  +            if( url_rewrite ) *url_rewrite=origChar;
  +            if( uriMap->mbean->debug > 0 )
  +                env->l->jkLog(env, env->l, JK_LOG_DEBUG,
  +                              "uriMap.mapUri() prefix match %s %s\n",
  +                              uri, match->workerName ); 
  +            return match;
  +        }
       }
   
       /* And extension match at the end */
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to