Re: Webtest doesn't like 204 response with Content-Type header

2009-01-22 Thread Wichert Akkerman
Previously Chris Miles wrote: That is fair enough, but if the controller returns no content (None or for instance) would it make sense to not set any Content-Type (and related) headers? At the very least you have to send a Content-Length: 0 header. If you don't some proxies get confused

Re: Webtest doesn't like 204 response with Content-Type header

2009-01-22 Thread Joshua Bronson
On Jan 22, 3:38 am, Wichert Akkerman wich...@wiggy.net wrote: At the very least you have to send a Content-Length: 0 header. If you don't some proxies get confused and some browsers will spin forever waiting for data to arrive. Wichert. Indeed, and in Pylons 0.9.6.2 ErrorDocuments responses

Re: Webtest doesn't like 204 response with Content-Type header

2009-01-21 Thread Domhnall Walsh
Personally, I reckon that if a response shouldn't contain any content, then it stands to reason that a content-type header is pointless (why tell the browser what type of data the non-existent content has?). As such, I'd imagine the interpretation is strict but valid. Regards, Domhnall.

Re: Webtest doesn't like 204 response with Content-Type header

2009-01-21 Thread Mike Orr
Well, Pylons and webob.Response are geared for the normal case of sending HTML documents. If you do something different, you have to set all necessary headers yourself. That's what the redirect/redirect_to() and abort() functions do; change the headers to match common scenarios. Perhaps abort

Webtest doesn't like 204 response with Content-Type header

2009-01-20 Thread Chris Miles
I have a simple Pylons controller that responds to PUT requests with a 204 (No Content) status and no entity body. For example (stripped down):: class DataController(BaseController): def test_put(self): do_something() response.status = 204 # No content