summaryrefslogtreecommitdiffstats
path: root/Lib/BaseHTTPServer.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-03-30 20:17:31 (GMT)
committerGuido van Rossum <guido@python.org>1999-03-30 20:17:31 (GMT)
commit60e7330fee3e34732ab55cd6bb1212e138c11f7f (patch)
treecd48b512d8f1e300e32418d43eb9813220038eae /Lib/BaseHTTPServer.py
parent275e83489efabfb26bc09f193e379e3bc690c3b6 (diff)
downloadcpython-60e7330fee3e34732ab55cd6bb1212e138c11f7f.zip
cpython-60e7330fee3e34732ab55cd6bb1212e138c11f7f.tar.gz
cpython-60e7330fee3e34732ab55cd6bb1212e138c11f7f.tar.bz2
Per Cederqvist writes:
If you send something like "PUT / HTTP/1.0" to something derived from BaseHTTPServer that doesn't define do_PUT, you will get a response that begins like this: HTTP/1.0 501 Unsupported method ('do_PUT') Server: SimpleHTTP/0.3 Python/1.5 Date: Tue, 30 Mar 1999 18:53:53 GMT The server should complain about 'PUT' instead of 'do_PUT'. This patch should fix the problem.
Diffstat (limited to 'Lib/BaseHTTPServer.py')
-rw-r--r--Lib/BaseHTTPServer.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/BaseHTTPServer.py b/Lib/BaseHTTPServer.py
index 7c8975d..4c9645d 100644
--- a/Lib/BaseHTTPServer.py
+++ b/Lib/BaseHTTPServer.py
@@ -252,7 +252,7 @@ class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler):
self.headers = self.MessageClass(self.rfile, 0)
mname = 'do_' + command
if not hasattr(self, mname):
- self.send_error(501, "Unsupported method (%s)" % `mname`)
+ self.send_error(501, "Unsupported method (%s)" % `command`)
return
method = getattr(self, mname)
method()