summaryrefslogtreecommitdiffstats
path: root/Lib/BaseHTTPServer.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-02-12 23:58:38 (GMT)
committerGuido van Rossum <guido@python.org>1996-02-12 23:58:38 (GMT)
commitf69da220bfe1b8a0b8a061a0463fbb7d542ffa0f (patch)
treebf90c32bfe4c17c042ee0c53b88f3f6498356f81 /Lib/BaseHTTPServer.py
parentfeeadef61e9b88af0a7ea55a2e8851f0dc5365c0 (diff)
downloadcpython-f69da220bfe1b8a0b8a061a0463fbb7d542ffa0f.zip
cpython-f69da220bfe1b8a0b8a061a0463fbb7d542ffa0f.tar.gz
cpython-f69da220bfe1b8a0b8a061a0463fbb7d542ffa0f.tar.bz2
fix several bogus var refs in error reporting
Diffstat (limited to 'Lib/BaseHTTPServer.py')
-rw-r--r--Lib/BaseHTTPServer.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/BaseHTTPServer.py b/Lib/BaseHTTPServer.py
index 681139b..281ddf6 100644
--- a/Lib/BaseHTTPServer.py
+++ b/Lib/BaseHTTPServer.py
@@ -226,6 +226,7 @@ class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler):
"""
self.raw_requestline = self.rfile.readline()
+ self.request_version = version = "HTTP/0.9" # Default
requestline = self.raw_requestline
if requestline[-2:] == '\r\n':
requestline = requestline[:-2]
@@ -244,15 +245,14 @@ class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler):
self.send_error(400,
"Bad HTTP/0.9 request type (%s)" % `command`)
return
- version = "HTTP/0.9"
else:
- self.send_error(400, "Bad request syntax (%s)" % `command`)
+ self.send_error(400, "Bad request syntax (%s)" % `requestline`)
return
self.command, self.path, self.request_version = command, path, version
self.headers = self.MessageClass(self.rfile, 0)
mname = 'do_' + command
if not hasattr(self, mname):
- self.send_error(501, "Unsupported method (%s)" % `command`)
+ self.send_error(501, "Unsupported method (%s)" % `mname`)
return
method = getattr(self, mname)
method()