httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy T. Fielding" <field...@ebuilt.com>
Subject [PATCH] check Expect after post_read_request
Date Fri, 10 Nov 2000 21:20:52 GMT
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 <jerenkrantz@ebuilt.com>.

....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;

Mime
View raw message