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.
This commit is contained in:
Guido van Rossum 1999-03-30 20:17:31 +00:00
parent 275e83489e
commit 60e7330fee
1 changed files with 1 additions and 1 deletions

View File

@ -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()