15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1 s11-update
authorPetr Sumbera <petr.sumbera@oracle.com>
Thu, 22 Nov 2012 06:15:30 -0800
branchs11-update
changeset 2429 cf97b079f90d
parent 2428 77b26ec5be97
child 2430 e5c2ebd2643a
15787737 SUNBT7164140 ErrorDocument can not handle 400status properly in case of HTTP 1.1
components/apache2/patches/bug48357.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/apache2/patches/bug48357.patch	Thu Nov 22 06:15:30 2012 -0800
@@ -0,0 +1,39 @@
+https://issues.apache.org/bugzilla/show_bug.cgi?id=48357
+
+--- server/protocol.c	Tue Jan 24 12:02:19 2012
++++ server/protocol.c	Mon Oct  1 04:53:41 2012
+@@ -869,7 +869,7 @@
+     request_rec *r;
+     apr_pool_t *p;
+     const char *expect;
+-    int access_status;
++    int access_status = HTTP_OK;
+     apr_bucket_brigade *tmp_bb;
+     apr_socket_t *csd;
+     apr_interval_time_t cur_timeout;
+@@ -1021,7 +1021,7 @@
+          * HTTP/1.1 mentions twice (S9, S14.23) that a request MUST contain
+          * a Host: header, and the server MUST respond with 400 if it doesn't.
+          */
+-        r->status = HTTP_BAD_REQUEST;
++        access_status = HTTP_BAD_REQUEST;
+         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+                       "client sent HTTP/1.1 request without hostname "
+                       "(see RFC2616 section 14.23): %s", r->uri);
+@@ -1037,14 +1037,8 @@
+     ap_add_input_filter_handle(ap_http_input_filter_handle,
+                                NULL, r, r->connection);
+ 
+-    if (r->status != HTTP_OK) {
+-        ap_send_error_response(r, 0);
+-        ap_update_child_status(conn->sbh, SERVER_BUSY_LOG, r);
+-        ap_run_log_transaction(r);
+-        return r;
+-    }
+-
+-    if ((access_status = ap_run_post_read_request(r))) {
++    if (access_status != HTTP_OK
++        || (access_status = ap_run_post_read_request(r))) {
+         ap_die(access_status, r);
+         ap_update_child_status(conn->sbh, SERVER_BUSY_LOG, r);
+         ap_run_log_transaction(r);