[mod_python] Handing Expect: 100-continue from inside mod_python]

Mike Looijmans nlv11281 at natlab.research.philips.com
Tue May 30 08:51:40 EDT 2006


I think you'll have to write the 100 response header(s) and status line 
to the underlying connection object. Otherwise, apache will think that 
the request is finished, and weird things will happen.


Simply closing the connection is not so bad - the server is free to do
that anyway. Outputting a "Connection: Close" header along with your
error mesage is good practice. That's what I use since 100-continues are
a pain in the neck to get right on the client side (Python's httplib
cannot handle them).


Mike Looijmans
Philips Natlab / Topic Automation


Joshua Ginsberg wrote:
>>From the mod_python manual:
> 
> http://modpython.org/live/current/doc-html/pyapi-handler.html
> 
> -jag
> 
> On Tue, 2006-05-23 at 13:31 -0400, jarrod roberson wrote:
> 
>>I have been googling and have not been able to find any information
>>about how to have my mod_python handler respond with a 100 Continue or
>>417 Expectation Failed. We are checking quota on PUT's and want to be
>>able to support Expect: 100-continue for PUTs so the client ( which we
>>are in charge of and Content-Lenght is required by the server ). Right
>>now we just drop the connection if the the PUT will fail, it would be
>>much nicer to respond in a more friendly manner. 
>>_______________________________________________
>>Mod_python mailing list
>>Mod_python at modpython.org
>>http://mailman.modpython.org/mailman/listinfo/mod_python
> 
> 
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
> 


-- 
Mike Looijmans
Philips Natlab / Topic Automation



More information about the Mod_python mailing list