You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rp...@apache.org on 2011/10/25 17:56:08 UTC

svn commit: r1188745 - /httpd/httpd/trunk/server/protocol.c

Author: rpluem
Date: Tue Oct 25 15:56:08 2011
New Revision: 1188745

URL: http://svn.apache.org/viewvc?rev=1188745&view=rev
Log:
* Correctly return a 400 (Bad request) in case of a HTTP/0.9 request like
  GET @example.org/foo

Modified:
    httpd/httpd/trunk/server/protocol.c

Modified: httpd/httpd/trunk/server/protocol.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/protocol.c?rev=1188745&r1=1188744&r2=1188745&view=diff
==============================================================================
--- httpd/httpd/trunk/server/protocol.c (original)
+++ httpd/httpd/trunk/server/protocol.c Tue Oct 25 15:56:08 2011
@@ -672,6 +672,7 @@ static int read_request_line(request_rec
         r->hostname = NULL;
         r->status = HTTP_BAD_REQUEST;
         r->uri = apr_pstrdup(r->pool, uri);
+        return 0;
     }
 
     if (ll[0]) {
@@ -986,15 +987,15 @@ request_rec *ap_read_request(conn_rec *c
     if (!read_request_line(r, tmp_bb)) {
         if (r->status == HTTP_REQUEST_URI_TOO_LARGE
             || r->status == HTTP_BAD_REQUEST) {
-            if (r->status == HTTP_BAD_REQUEST) {
-                ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r,
-                              "request failed: invalid characters in URI");
-            }
-            else {
+            if (r->status == HTTP_REQUEST_URI_TOO_LARGE) {
                 ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r,
                               "request failed: URI too long (longer than %d)",
                               r->server->limit_req_line);
             }
+            else if (r->method == NULL) {
+                ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r,
+                              "request failed: invalid characters in URI");
+            }
             ap_send_error_response(r, 0);
             ap_update_child_status(conn->sbh, SERVER_BUSY_LOG, r);
             ap_run_log_transaction(r);