(defn wrap-head
"Middleware that turns any HEAD request into a GET, and then sets the response
body to nil."
{:added "1.1"}
[handler]
(fn
([request]
(-> request
head-request
handler
(head-response request)))
([request respond raise]
(handler (head-request request)
(fn [response] (respond (head-response response request)))
raise))))