On Mar 10, 2011, at 2:17 PM, Stephen Lacy wrote:

> Ah, the custom predicates makes sense, but the syntax is really obtuse. 
> 
> I'll look (briefly) at coding up request_method=('GET', 'HEAD') and submit a 
> pull request if there's no objection here.  I suspect it's as simple as 
> replacing "==" with "in".  :) 
> 
> Yeah, so I'm just interested in how to send back the same response for HEAD 
> as I do for GET, and I'm going to let apache drop the body (which it should 
> to conform to the spec). 
> 
> Is there any way to tell apache "just make a GET request for a HEAD, and 
> throw away the body and respond as usual?"   That way I don't have to put a 
> custom predicate on every single view.  
> 
> Alternatively, is this something nginx can do easily?  (even better, if nginx 
> did somithng smart for the if-modified-since header, etc. that would also be 
> awesome, but I'm a total nginx noob)


I think webob will handle HEAD for you. If you just leave the request_method 
undefined a HEAD request will get the right response from webob. If you need to 
define separate view callables for PUT and/or POST just define them in 
different @view_config and order them/it before the default.

~ro


-- 
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To post to this group, send email to pylons-devel@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-devel?hl=en.

Reply via email to