Changeset 1838

Show
Ignore:
Timestamp:
05/08/2007 02:27:12 PM (16 months ago)
Author:
jan
Message:

allow to rewrite the pathinfo if no path-check is enabled

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/mod_proxy_core.c

    r1824 r1838  
    13161316                                buffer_copy_string_buffer(sess->request_uri, p->replace_buf); 
    13171317                        } 
    1318  
    1319                         break; 
    13201318                } else if (buffer_is_equal_string(rw->header, CONST_STR_LEN("_docroot"))) { 
    13211319                        int ret; 
     
    13371335                                buffer_copy_string_buffer(con->physical.path, p->replace_buf); 
    13381336                                buffer_append_string_buffer(con->physical.path, con->physical.rel_path); 
     1337                        } 
     1338                } else if (buffer_is_equal_string(rw->header, CONST_STR_LEN("_pathinfo"))) { 
     1339                        int ret; 
     1340 
     1341                        if ((ret = pcre_replace(rw->regex, rw->replace, con->request.uri, p->replace_buf)) < 0) { 
     1342                                switch (ret) { 
     1343                                case PCRE_ERROR_NOMATCH: 
     1344                                        /* hmm, ok. no problem */ 
     1345                                        break; 
     1346                                default: 
     1347                                        TRACE("oops, pcre_replace failed with: %d", ret); 
     1348                                        break; 
     1349                                } 
     1350                        } else { 
     1351                                /* we matched, cool. */ 
     1352                                buffer_copy_string_buffer(con->request.pathinfo, p->replace_buf); 
    13391353                        } 
    13401354                }