From: Ian Holsman Date: Wed, 20 Feb 2002 20:25:15 +0000 (+0000) Subject: send a 'bad-gateway' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4fd4c401ae4bb87a59c3af74370c2b89e2d09789;p=apache 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 --- 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;