View | Details | Raw Unified | Return to bug 48359
Collapse All | Expand All

(-)server/protocol.c (-10 / +7 lines)
Lines 1041-1055 Link Here
1041
    return r;
1041
    return r;
1042
}
1042
}
1043
1043
1044
/* if a request with a body creates a subrequest, clone the original request's
1044
/* if a request with a body creates a subrequest, remove original request's
1045
 * input headers minus any headers pertaining to the body which has already
1045
 * input headers which pertain to the body which has already been read.
1046
 * been read.  out-of-line helper function for ap_set_sub_req_protocol.
1046
 * out-of-line helper function for ap_set_sub_req_protocol.
1047
 */
1047
 */
1048
1048
1049
static void clone_headers_no_body(request_rec *rnew,
1049
static void strip_headers_request_body(request_rec *rnew)
1050
                                  const request_rec *r)
1051
{
1050
{
1052
    rnew->headers_in = apr_table_copy(rnew->pool, r->headers_in);
1053
    apr_table_unset(rnew->headers_in, "Content-Encoding");
1051
    apr_table_unset(rnew->headers_in, "Content-Encoding");
1054
    apr_table_unset(rnew->headers_in, "Content-Language");
1052
    apr_table_unset(rnew->headers_in, "Content-Language");
1055
    apr_table_unset(rnew->headers_in, "Content-Length");
1053
    apr_table_unset(rnew->headers_in, "Content-Length");
Lines 1083-1097 Link Here
1083
1081
1084
    rnew->status          = HTTP_OK;
1082
    rnew->status          = HTTP_OK;
1085
1083
1084
    rnew->headers_in = apr_table_copy(rnew->pool, r->headers_in);
1085
1086
    /* did the original request have a body?  (e.g. POST w/SSI tags)
1086
    /* did the original request have a body?  (e.g. POST w/SSI tags)
1087
     * if so, make sure the subrequest doesn't inherit body headers
1087
     * if so, make sure the subrequest doesn't inherit body headers
1088
     */
1088
     */
1089
    if (apr_table_get(r->headers_in, "Content-Length")
1089
    if (apr_table_get(r->headers_in, "Content-Length")
1090
        || apr_table_get(r->headers_in, "Transfer-Encoding")) {
1090
        || apr_table_get(r->headers_in, "Transfer-Encoding")) {
1091
        clone_headers_no_body(rnew, r);
1091
        strip_headers_request_body(rnew, r);
1092
    } else {
1093
        /* no body (common case).  clone headers the cheap way */
1094
        rnew->headers_in      = r->headers_in;
1095
    }
1092
    }
1096
    rnew->subprocess_env  = apr_table_copy(rnew->pool, r->subprocess_env);
1093
    rnew->subprocess_env  = apr_table_copy(rnew->pool, r->subprocess_env);
1097
    rnew->headers_out     = apr_table_make(rnew->pool, 5);
1094
    rnew->headers_out     = apr_table_make(rnew->pool, 5);

Return to bug 48359