</usage>
</directivesynopsis>
+<directivesynopsis>
+<name>Proxy100Continue</name>
+<description>Forward 100-continue expectation to the origin server</description>
+<syntax>Proxy100Continue Off|On</syntax>
+<default>Proxy100Continue On</default>
+<contextlist><context>server config</context>
+<context>virtual host</context>
+<context>directory</context>
+</contextlist>
+<compatibility>Available in version 2.4.39 and later</compatibility>
+
+<usage>
+ <p>This directive determines whether the proxy should forward 100-continue
+ <em>Expect:</em>ation to the origin server and thus let it decide when/if
+ the HTTP request body should be read, or when <code>Off</code> the proxy
+ should generate <em>100 Continue</em> intermediate response by itself before
+ forwarding the request body.</p>
+ <note><title>Effectiveness</title>
+ <p>This option is of use only for HTTP proxying, as handled by <module>mod_proxy_http</module>.</p>
+ </note>
+</usage>
+</directivesynopsis>
+
<directivesynopsis>
<name>ProxySourceAddress</name>
<description>Set local IP address for outgoing proxy connections</description>
* 20191203.1 (2.5.1-dev) Axe bucket number from struct process_score
* 20191203.2 (2.5.1-dev) Add ap_no2slash_ex() and merge_slashes to
* core_server_conf.
+ * 20191203.3 (2.5.1-dev) Add forward_100_continue{,_set} to proxy_dir_conf
*/
#define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */
#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20191203
#endif
-#define MODULE_MAGIC_NUMBER_MINOR 2 /* 0...n */
+#define MODULE_MAGIC_NUMBER_MINOR 3 /* 0...n */
/**
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a
new->error_override_set = 0;
new->add_forwarded_headers = 1;
new->add_forwarded_headers_set = 0;
+ new->forward_100_continue = 1;
+ new->forward_100_continue_set = 0;
return (void *) new;
}
: add->add_forwarded_headers;
new->add_forwarded_headers_set = add->add_forwarded_headers_set
|| base->add_forwarded_headers_set;
+ new->forward_100_continue =
+ (add->forward_100_continue_set == 0) ? base->forward_100_continue
+ : add->forward_100_continue;
+ new->forward_100_continue_set = add->forward_100_continue_set
+ || base->forward_100_continue_set;
return new;
}
conf->preserve_host_set = 1;
return NULL;
}
+static const char *
+ forward_100_continue(cmd_parms *parms, void *dconf, int flag)
+{
+ proxy_dir_conf *conf = dconf;
+ conf->forward_100_continue = flag;
+ conf->forward_100_continue_set = 1;
+ return NULL;
+}
static const char *
set_recv_buffer_size(cmd_parms *parms, void *dummy, const char *arg)
"Configure local source IP used for request forward"),
AP_INIT_FLAG("ProxyAddHeaders", add_proxy_http_headers, NULL, RSRC_CONF|ACCESS_CONF,
"on if X-Forwarded-* headers should be added or completed"),
+ AP_INIT_FLAG("Proxy100Continue", forward_100_continue, NULL, RSRC_CONF|ACCESS_CONF,
+ "on if 100-Continue should be forwarded to the origin server, off if the "
+ "proxy should handle it by itself"),
{NULL}
};
/** Named back references */
apr_array_header_t *refs;
+ unsigned int forward_100_continue:1;
+ unsigned int forward_100_continue_set:1;
} proxy_dir_conf;
/* if we interpolate env vars per-request, we'll need a per-request
proxy_conn_rec *backend = NULL;
int is_ssl = 0;
conn_rec *c = r->connection;
+ proxy_dir_conf *dconf;
int retry = 0;
char *locurl = url;
int toclose = 0;
req->bucket_alloc = c->bucket_alloc;
req->rb_method = RB_INIT;
+ dconf = ap_get_module_config(r->per_dir_config, &proxy_module);
+
/* Should we handle end-to-end or ping 100-continue? */
- if (r->expecting_100 || PROXY_DO_100_CONTINUE(worker, r)) {
+ if ((r->expecting_100 && dconf->forward_100_continue)
+ || PROXY_DO_100_CONTINUE(worker, r)) {
/* We need to reset r->expecting_100 or prefetching will cause
* ap_http_filter() to send "100 Continue" response by itself. So
* we'll use req->expecting_100 in mod_proxy_http to determine whether