Commit 6e1a3b8d authored by Shane Hathaway's avatar Shane Hathaway

Corrected handling of invalid requests.

parent 069fb45d
......@@ -6,7 +6,7 @@
# All Rights Reserved.
#
RCS_ID = '$Id: http_server.py,v 1.27 2001/07/02 13:48:46 chrism Exp $'
RCS_ID = '$Id: http_server.py,v 1.28 2001/07/02 19:44:26 shane Exp $'
# python modules
import os
......@@ -717,7 +717,7 @@ REQUEST = re.compile ('([^ ]+) ([^ ]+)(( HTTP/([0-9.]+))$|$)')
def crack_request (r):
m = REQUEST.match (r)
if m.end() == len(r):
if m is not None and m.end() == len(r):
if m.group(3):
version = m.group(5)
else:
......
......@@ -6,7 +6,7 @@
# All Rights Reserved.
#
RCS_ID = '$Id: http_server.py,v 1.27 2001/07/02 13:48:46 chrism Exp $'
RCS_ID = '$Id: http_server.py,v 1.28 2001/07/02 19:44:26 shane Exp $'
# python modules
import os
......@@ -717,7 +717,7 @@ REQUEST = re.compile ('([^ ]+) ([^ ]+)(( HTTP/([0-9.]+))$|$)')
def crack_request (r):
m = REQUEST.match (r)
if m.end() == len(r):
if m is not None and m.end() == len(r):
if m.group(3):
version = m.group(5)
else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment