HEAD method

3 views
Skip to first unread message

Antoine Latter

unread,
Nov 7, 2010, 4:45:14 AM11/7/10
to ha...@googlegroups.com
Hi Happstack,

Does anyone have any experience dealing with the HEAD HTTP method and
Happstack? Currently a handler guarded by, for example, 'methodSP
GET', will fail for a request of method HEAD.

This is understandable from a strictly technical level, but it seems
to be against the spirit of the RFC.

Maybe head requests aren't that useful, but I noticed this when
testing out a site with 'curl -I', which defaults to a method of HEAD
(as I told it to only display returned headers with the I switch).

I guess I'm more looking for anyone who has thought about this, rather
than requesting changes take place.

Antoine

Jeremy Shaw

unread,
Nov 7, 2010, 10:28:07 AM11/7/10
to ha...@googlegroups.com
Hello,

If you want HEAD to work then you need to do:

  do methodM [GET, HEAD]
        ...

instead of just, methodM GET.

later when the response is send, it will check if the rqMethod was HEAD and not send the body. See line 219:


However, it appears that SendFile branch needs a guard as well..

- jeremy

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


Reply all
Reply to author
Forward
0 new messages