From 1ab831fa0630107406cb1d7e54eeac26e502b0d9 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Wed, 15 May 2013 19:27:10 +0000 Subject: [PATCH] mod_proxy_http: Make the proxy-interim-response environment variable effective by formally overriding origin server behaviour. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1483027 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ modules/proxy/mod_proxy_http.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 1bedba70ad..a247db179c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,10 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 + *) mod_proxy_http: Make the proxy-interim-response environment variable + effective by formally overriding origin server behaviour. [Graham + Leggett, Co-Advisor ] + *) core: Stop the HTTP_IN filter from attempting to write error buckets to the output filters, which is bogus in the proxy case. Create a clean mapping from APR codes to HTTP status codes, and use it where diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c index b55b8cf4b0..55dabba2af 100644 --- a/modules/proxy/mod_proxy_http.c +++ b/modules/proxy/mod_proxy_http.c @@ -1532,12 +1532,16 @@ int ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, * behaviour here might break something. * * So let's make it configurable. + * + * We need to set "r->expecting_100 = 1" otherwise origin + * server behaviour will apply. */ const char *policy = apr_table_get(r->subprocess_env, "proxy-interim-response"); ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r, "HTTP: received interim %d response", r->status); - if (!policy || !strcasecmp(policy, "RFC")) { + if (!policy + || (!strcasecmp(policy, "RFC") && ((r->expecting_100 = 1)))) { ap_send_interim_response(r, 1); } /* FIXME: refine this to be able to specify per-response-status -- 2.40.0