]> granicus.if.org Git - apache/commitdiff
The protocol version (eg: HTTP/1.1) in the request line parsing
authorJim Jagielski <jim@apache.org>
Tue, 17 Sep 2002 01:14:57 +0000 (01:14 +0000)
committerJim Jagielski <jim@apache.org>
Tue, 17 Sep 2002 01:14:57 +0000 (01:14 +0000)
is now case insensitive. Before, 'http/1.1' would silently be forced
to HTTP/1.0

PR:
Obtained from:
Submitted by:
Reviewed by:

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96857 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
server/protocol.c

diff --git a/CHANGES b/CHANGES
index 4d9b091058e272f6d6e690cc6bde05de27d20436..a934a306484dd18f4fb4ea1a6e643f3ed27b62ec 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@ Changes with Apache 2.0.42
 
 Changes with Apache 2.0.41
 
+  *) The protocol version (eg: HTTP/1.1) in the request line parsing
+     is now case insensitive. [Jim Jagielski]
+
   *) Allow AddOutputFilterByType to add multiple filters per directive.
      [Justin Erenkrantz]
 
index b228e811272a720a93cc63e392f4b0bb3b86c1f1..b7db987913107439343786cd5fd33a4e3c2b62ea 100644 (file)
@@ -642,6 +642,7 @@ static int read_request_line(request_rec *r, apr_bucket_brigade *bb)
     conn_rec *conn = r->connection;
 #endif
     int major = 1, minor = 0;   /* Assume HTTP/1.0 if non-"HTTP" protocol */
+    char http[5];
     apr_size_t len;
 
     /* Read past empty lines until we get a real request line,
@@ -732,8 +733,9 @@ static int read_request_line(request_rec *r, apr_bucket_brigade *bb)
         && apr_isdigit(pro[7])) {
         r->proto_num = HTTP_VERSION(pro[5] - '0', pro[7] - '0');
     }
-    else if (2 == sscanf(r->protocol, "HTTP/%u.%u", &major, &minor)
-             && minor < HTTP_VERSION(1, 0)) /* don't allow HTTP/0.1000 */
+    else if (3 == sscanf(r->protocol, "%4s/%u.%u", http, &major, &minor)
+             && (strcasecmp("http", http) == 0)
+             && (minor < HTTP_VERSION(1, 0)) ) /* don't allow HTTP/0.1000 */
         r->proto_num = HTTP_VERSION(major, minor);
     else
         r->proto_num = HTTP_VERSION(1, 0);