Changeset 1841

Show
Ignore:
Timestamp:
05/08/2007 03:47:18 PM (16 months ago)
Author:
jan
Message:

allow to rewrite PATH_INFO and SCRIPT_NAME. trac needs that

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/mod_proxy_core.c

    r1838 r1841  
    13391339                        int ret; 
    13401340 
    1341                         if ((ret = pcre_replace(rw->regex, rw->replace, con->request.uri, p->replace_buf)) < 0) { 
     1341                        if ((ret = pcre_replace(rw->regex, rw->replace, con->uri.path, p->replace_buf)) < 0) { 
    13421342                                switch (ret) { 
    13431343                                case PCRE_ERROR_NOMATCH: 
     
    13521352                                buffer_copy_string_buffer(con->request.pathinfo, p->replace_buf); 
    13531353                        } 
     1354                } else if (buffer_is_equal_string(rw->header, CONST_STR_LEN("_scriptname"))) { 
     1355                        int ret; 
     1356 
     1357                        if ((ret = pcre_replace(rw->regex, rw->replace, con->uri.path, p->replace_buf)) < 0) { 
     1358                                switch (ret) { 
     1359                                case PCRE_ERROR_NOMATCH: 
     1360                                        /* hmm, ok. no problem */ 
     1361                                        break; 
     1362                                default: 
     1363                                        TRACE("oops, pcre_replace failed with: %d", ret); 
     1364                                        break; 
     1365                                } 
     1366                        } else { 
     1367                                /* we matched, cool. */ 
     1368                                buffer_copy_string_buffer(con->uri.path, p->replace_buf); 
     1369                        } 
     1370 
    13541371                } 
    13551372        }