[Twisted-Python] Serving HTTP requests (was: Bug?)

Wari Wahab wari at home.wari.org
Fri May 23 00:58:12 EDT 2003


Andrew Bennetts wrote:

>On Fri, May 23, 2003 at 12:19:26PM +0800, Wari Wahab wrote:
>  
>
>>If the request is wrong, shouldn't twisted.web complain about it at a 
>>point earlier than the XMLRPC resource? If it lets the request thru, why 
>>does request.content becomes empty. Or, shouldn't the XMLRPC client adds 
>>a '/' at least when there is no URI (URL?) in the request?
>>    
>>
>That's for taking the time to investigate this!
>Does this patch to the Proxy class fix the problem?
>  
>
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:

sync:~/web$ telnet localhost 80
Trying 127.0.0.1...
Connected to sync.
Escape character is '^]'.
POST  HTTP/1.0
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>400 Bad Request</TITLE>
</HEAD><BODY>
<H1>Bad Request</H1>
Your browser sent a request that this server could not understand.<P>
Invalid URI in request POST  HTTP/1.0<P>
<HR>
<ADDRESS>Apache/1.3.26 Server at sync.sg.celestix.com Port 80</ADDRESS>
</BODY></HTML>
Connection closed by foreign host.

In the case of a microsoft server, it does this:
sync:~/web$ telnet www.microsoft.com 80
Trying 207.46.249.222...
Connected to www.us.microsoft.com.
Escape character is '^]'.
POST  HTTP/1.0
Connection closed by foreign host.

I like the apache way better :)





More information about the Twisted-Python mailing list