Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 56156 invoked from network); 6 Jul 2005 02:02:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Jul 2005 02:02:01 -0000 Received: (qmail 41054 invoked by uid 500); 6 Jul 2005 02:02:00 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 41019 invoked by uid 500); 6 Jul 2005 02:01:59 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 41006 invoked by uid 99); 6 Jul 2005 02:01:59 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 05 Jul 2005 19:01:59 -0700 Received: (qmail 56137 invoked by uid 65534); 6 Jul 2005 02:01:56 -0000 Message-ID: <20050706020156.56136.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r209384 - in /httpd/httpd/branches/1.3.x/src/modules/proxy: mod_proxy.c proxy_http.c Date: Wed, 06 Jul 2005 02:01:55 -0000 To: cvs@httpd.apache.org From: wrowe@apache.org X-Mailer: svnmailer-1.0.2 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: wrowe Date: Tue Jul 5 19:01:54 2005 New Revision: 209384 URL: http://svn.apache.org/viewcvs?rev=209384&view=rev Log: The TRACE method control belonged in mod_proxy, it shouldn't have been hiding in the http-only proxy provider. Modified: httpd/httpd/branches/1.3.x/src/modules/proxy/mod_proxy.c httpd/httpd/branches/1.3.x/src/modules/proxy/proxy_http.c Modified: httpd/httpd/branches/1.3.x/src/modules/proxy/mod_proxy.c URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/1.3.x/src/modules/proxy/mod_proxy.c?rev=209384&r1=209383&r2=209384&view=diff ============================================================================== --- httpd/httpd/branches/1.3.x/src/modules/proxy/mod_proxy.c (original) +++ httpd/httpd/branches/1.3.x/src/modules/proxy/mod_proxy.c Tue Jul 5 19:01:54 2005 @@ -18,6 +18,7 @@ #define CORE_PRIVATE #include "http_log.h" +#include "http_core.h" #include "http_vhost.h" #include "http_request.h" @@ -278,6 +279,38 @@ if ((rc = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR))) return rc; + + if (r->method_number == M_TRACE) { + core_server_config *coreconf = (core_server_config *) + ap_get_module_config(r->server->module_config, &core_module); + + if (coreconf->trace_enable == AP_TRACE_DISABLE) + { + /* Allow "error-notes" string to be printed by ap_send_error_response() + * Note; this goes nowhere, canned error response need an overhaul. + */ + ap_table_setn(r->notes, "error-notes", + "TRACE forbidden by server configuration"); + ap_table_setn(r->notes, "verbose-error-to", "*"); + ap_log_rerror(APLOG_MARK, APLOG_ERR, r, + "proxy: TRACE forbidden by server configuration"); + return HTTP_FORBIDDEN; + } + + if (coreconf->trace_enable != AP_TRACE_EXTENDED + && (r->read_length || r->read_chunked || r->remaining)) + { + /* Allow "error-notes" string to be printed by ap_send_error_response() + * Note; this goes nowhere, canned error response need an overhaul. + */ + ap_table_setn(r->notes, "error-notes", + "TRACE with request body is not allowed"); + ap_table_setn(r->notes, "verbose-error-to", "*"); + ap_log_rerror(APLOG_MARK, APLOG_ERR, r, + "proxy: TRACE with request body is not allowed"); + return HTTP_REQUEST_ENTITY_TOO_LARGE; + } + } url = r->filename + 6; p = strchr(url, ':'); Modified: httpd/httpd/branches/1.3.x/src/modules/proxy/proxy_http.c URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/1.3.x/src/modules/proxy/proxy_http.c?rev=209384&r1=209383&r2=209384&view=diff ============================================================================== --- httpd/httpd/branches/1.3.x/src/modules/proxy/proxy_http.c (original) +++ httpd/httpd/branches/1.3.x/src/modules/proxy/proxy_http.c Tue Jul 5 19:01:54 2005 @@ -15,7 +15,6 @@ /* HTTP routines for Apache proxy */ -#define CORE_PRIVATE /* To inspect core_server_conf->trace_enable */ #include "mod_proxy.h" #include "http_log.h" #include "http_main.h" @@ -141,24 +140,6 @@ memset(&server, '\0', sizeof(server)); server.sin_family = AF_INET; - - if (r->method_number == M_TRACE) { - core_server_config *coreconf = (core_server_config *) - ap_get_module_config(r->server->module_config, &core_module); - - if (coreconf->trace_enable == AP_TRACE_DISABLE) - return ap_proxyerror(r, HTTP_FORBIDDEN, - "TRACE denied by server configuration"); - - /* Can't test ap_should_client_block, we aren't ready to send - * the client a 100 Continue response till the connection has - * been established - */ - if (coreconf->trace_enable != AP_TRACE_EXTENDED - && (r->read_length || (!r->read_chunked && (r->remaining <= 0)))) - return ap_proxyerror(r, HTTP_REQUEST_ENTITY_TOO_LARGE, - "TRACE with request body is not allowed"); - } /* We break the URL into host, port, path-search */