From 0a70e420a5c5905a1525def8eb7b0770fce9b61b Mon Sep 17 00:00:00 2001 From: Ian Holsman Date: Wed, 20 Feb 2002 20:25:15 +0000 Subject: [PATCH] send a 'bad-gateway' when a invaild response flys in git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93519 13f79535-47bb-0310-9956-ffa450edef68 --- modules/proxy/proxy_http.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/proxy/proxy_http.c b/modules/proxy/proxy_http.c index aaf7817782..d2bab6cbb0 100644 --- a/modules/proxy/proxy_http.c +++ b/modules/proxy/proxy_http.c @@ -737,6 +737,16 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, "returned by %s (%s)", major, minor, r->uri, r->method); p_conn->close += 1; + /* + * ap_send_error relies on a headers_out to be present. we + * are in a bad position here.. so force everything we send out + * to have nothing to do with the incoming packet + */ + r->headers_out = apr_table_make(r->pool,1); + r->status = HTTP_BAD_GATEWAY; + r->status_line = "bad gateway"; + return r->status; + } else { /* strip connection listed hop-by-hop headers from response */ const char *buf; -- 2.50.1