1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-08 15:02:10 +03:00

mod_proxy_http: Follow up to r1901420: consistent 100-continue checks.

Let proxy_http_handler() tell ap_proxy_create_hdrbrgd() whether to add or
preserve Expect header or not, through the "proxy-100-continue" note.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1901446 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yann Ylavic
2022-05-31 11:05:41 +00:00
parent 9a8214d08f
commit d161bb4cc2
2 changed files with 11 additions and 5 deletions

View File

@@ -3891,7 +3891,7 @@ PROXY_DECLARE(int) ap_proxy_create_hdrbrgd(apr_pool_t *p,
char *buf;
apr_table_t *saved_headers_in, *request_headers;
apr_bucket *e;
int force10 = 0, ping100 = 0;
int force10 = 0, do_100_continue = 0;
conn_rec *origin = p_conn->connection;
const char *creds;
proxy_dir_conf *dconf = ap_get_module_config(r->per_dir_config, &proxy_module);
@@ -3904,8 +3904,9 @@ PROXY_DECLARE(int) ap_proxy_create_hdrbrgd(apr_pool_t *p,
if (apr_table_get(r->subprocess_env, "force-proxy-request-1.0")) {
force10 = 1;
}
else if (PROXY_SHOULD_PING_100_CONTINUE(worker, r)) {
ping100 = 1;
else if (apr_table_get(r->notes, "proxy-100-continue")
|| PROXY_SHOULD_PING_100_CONTINUE(worker, r)) {
do_100_continue = 1;
}
if (force10 || apr_table_get(r->subprocess_env, "proxy-nokeepalive")) {
if (origin) {
@@ -4012,7 +4013,7 @@ PROXY_DECLARE(int) ap_proxy_create_hdrbrgd(apr_pool_t *p,
/* Use HTTP/1.1 100-Continue as quick "HTTP ping" test
* to backend
*/
if (ping100) {
if (do_100_continue) {
/* Add the Expect header if not already there. */
const char *val = apr_table_get(request_headers, "Expect");
if (!val || (ap_cstr_casecmp(val, "100-Continue") != 0 /* fast path */
@@ -4020,7 +4021,10 @@ PROXY_DECLARE(int) ap_proxy_create_hdrbrgd(apr_pool_t *p,
apr_table_mergen(request_headers, "Expect", "100-Continue");
}
}
else if (force10 || !dconf->forward_100_continue || !r->expecting_100) {
else {
/* XXX: we should strip the 100-continue token only from the
* Expect header, but are there others actually used anywhere?
*/
apr_table_unset(request_headers, "Expect");
}