Ticket #1643 (new defect)

Opened 3 months ago

_pathinfo and _scriptname overwriting

Reported by: osmaker+lighttpd@gmail.com Assigned to: jan
Priority: normal Milestone: 1.5.0
Component: mod_proxy_core Version: 1.5.x-svn
Severity: major Keywords: _scriptname, _pathinfo, request headers
Cc: Blocking:
Need Feedback: 0

Description

From comments in #1600 (this was not addressed in the submitted patch, nor can I find a separate ticket for this issue):

In a conf file, you must handle _pathinfo before _scriptname because otherwise con->uri.path will be overwritten with whatever value you have set for _scriptname as can be seen here:

} else if (buffer_is_equal_string(rw->header, CONST_STR_LEN("_scriptname"))) {
        int ret;

        if ((ret = pcre_replace(rw->regex, rw->replace, con->uri.path, p->replace_buf)) < 0) {
                switch (ret) {
                case PCRE_ERROR_NOMATCH:
                /* hmm, ok. no problem */
                break;
                default:
                TRACE("oops, pcre_replace failed with: %d", ret);
                break;
                }
        } else {
                /* we matched, cool. */
                buffer_copy_string_buffer(con->uri.path, p->replace_buf);
        }
}

Attachments


Add/Change #1643 (_pathinfo and _scriptname overwriting)




Change Properties