On Mar 10, 2011, at 1:44 PM, Stephen Lacy wrote:

> What's the recommended way to get proper HEAD request support using pyramid + 
> mod_wsgi?
> 
> Right now, with my "vanilla" mod_wsgi configs, and request_method='GET' on my 
> view_config decorators, my HEAD requests are 404'ing.   I tried setting 
> request_method=['GET', 'HEAD'] but it seems as this syntax isn't supported.  
> I couldn't find anything about HEAD requests in the docs.

request_method takes a string.

You could do something like

is_head_or_get(request):
    return request.method in ('HEAD', 'GET')


And use it thusly:

@view_config(custom_predicates=(is_head_or_get,))
def aview(request):
    do_stuff....



Cheers,
~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