From: Yann Ylavic Date: Fri, 18 Apr 2014 17:17:06 +0000 (+0000) Subject: mod_proxy: When ping/pong is configured for a worker, don't send or forward X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=101976bdc6865ea18ed5d9336dcc539e25d3ad55;p=thirdparty%2Fapache%2Fhttpd.git mod_proxy: When ping/pong is configured for a worker, don't send or forward "100 Continue" (interim) response to the client if it does not expect one. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1588519 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 23dfba334b4..b532e95dc81 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -3312,8 +3312,22 @@ PROXY_DECLARE(int) ap_proxy_create_hdrbrgd(apr_pool_t *p, * to backend */ if (do_100_continue) { - apr_table_mergen(r->headers_in, "Expect", "100-Continue"); - r->expecting_100 = 1; + const char *val; + + if (!r->expecting_100) { + /* Don't forward any "100 Continue" response if the client is + * not expecting it. + */ + apr_table_setn(r->subprocess_env, "proxy-interim-response", + "Suppress"); + } + + /* Add the Expect header if not already there. */ + if (((val = apr_table_get(r->headers_in, "Expect")) == NULL) + || (strcasecmp(val, "100-Continue") != 0 // fast path + && !ap_find_token(r->pool, val, "100-Continue"))) { + apr_table_mergen(r->headers_in, "Expect", "100-Continue"); + } } /* X-Forwarded-*: handling