diff --git a/gunicorn/http/message.py b/gunicorn/http/message.py index 39691664..0c83b89f 100644 --- a/gunicorn/http/message.py +++ b/gunicorn/http/message.py @@ -23,7 +23,7 @@ DEFAULT_MAX_HEADERFIELD_SIZE = 8190 HEADER_RE = re.compile("[\x00-\x1F\x7F()<>@,;:\[\]={} \t\\\\\"]") METH_RE = re.compile(r"[A-Z0-9$-_.]{3,20}") -VERSION_RE = re.compile(r"HTTP/(\d+).(\d+)") +VERSION_RE = re.compile(r"HTTP/(\d+)\.(\d+)") class Message(object): diff --git a/tests/requests/invalid/018.http b/tests/requests/invalid/018.http new file mode 100644 index 00000000..a871238b --- /dev/null +++ b/tests/requests/invalid/018.http @@ -0,0 +1,3 @@ +GET /test HTTP/111\r\n +Host: localhost\r\n +\r\n diff --git a/tests/requests/invalid/018.py b/tests/requests/invalid/018.py new file mode 100644 index 00000000..760840b6 --- /dev/null +++ b/tests/requests/invalid/018.py @@ -0,0 +1,2 @@ +from gunicorn.http.errors import InvalidHTTPVersion +request = InvalidHTTPVersion