[Twisted-Python] Serving HTTP requests (was: Bug?)
Andrew Bennetts
andrew-twisted at puzzling.org
Thu May 22 23:07:59 MDT 2003
On Fri, May 23, 2003 at 12:58:12PM +0800, Wari Wahab wrote:
> Yes that fixed the problem nicely. Though I also do think that is the
> request is wrong, twisted should complain, as in the case of Apache:
[snip 400 Bad request vs. dropping the connection]
Twisted's HTTP implementation does this:
parts = line.split()
if len(parts)<3:
parts.append('HTTP/0.9') # isn't backwards compat great!
if len(parts) != 3:
self.transport.write("HTTP/1.1 400 Bad Request\r\n\r\n")
self.transport.loseConnection()
return
So "POST HTTP/1.0" becomes "POST HTTP/1.0 HTTP/0.9"! (This of course
results in a 404)
Does anyone know what clients is the "parts.append('HTTP/0.9')" backwards
compat hack is there for?
-Andrew.
More information about the Twisted-Python
mailing list