Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 56109 invoked by uid 500); 11 Nov 2000 05:18:09 -0000 Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Precedence: bulk Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list new-httpd@apache.org Received: (qmail 56098 invoked from network); 11 Nov 2000 05:18:08 -0000 Message-Id: <200011102120.NAA07360@mana.ebuilt.com> To: new-httpd@apache.org Subject: [PATCH] check Expect after post_read_request Date: Fri, 10 Nov 2000 13:20:52 -0800 From: "Roy T. Fielding" X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Expect is an annoying header field, added to HTTP in RFC 2616, that requires an error response if it contains an extension token that the server does not understand. Unfortunately, we check it before we give any of the modules a chance to see and "handle" such an extension. This moves the check after post_read_request. I can't imagine this breaking anything, but let me know if you do. The patch is against 1.3, but probably applies to 2.0 as well. The author is Justin Erenkrantz . ....Roy Index: http_protocol.c =================================================================== RCS file: /home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.292 diff -u -r1.292 http_protocol.c --- http_protocol.c 2000/11/06 22:05:13 1.292 +++ http_protocol.c 2000/11/11 05:06:21 @@ -1124,6 +1124,13 @@ ap_log_transaction(r); return r; } + + if ((access_status = ap_run_post_read_request(r))) { + ap_die(access_status, r); + ap_log_transaction(r); + return NULL; + } + if (((expect = ap_table_get(r->headers_in, "Expect")) != NULL) && (expect[0] != '\0')) { /* @@ -1145,12 +1152,6 @@ ap_log_transaction(r); return r; } - } - - if ((access_status = ap_run_post_read_request(r))) { - ap_die(access_status, r); - ap_log_transaction(r); - return NULL; } return r;