fast-twitch.middlewares.head
Complete generated reference for fast-twitch.middlewares.head
Usage and execution boundary
Runs GET behavior for an incoming HEAD request, then removes and disposes the response body using the original request method. A route accepting :head alone does not implement this body cleanup.
(ns application.middleware
(:require [fast-twitch.middlewares.head :as middleware]))
(defn handler [_]
{:status 200 :headers {"content-type" "text/plain"} :body "Hello"})
(def app (middleware/wrap-head handler))
This defines the Ring handler portion. Adapt app through routing/ft-handler or pass it to server/listen!; startup instructions and a complete walkthrough show the surrounding project.
Wrapper order and all middleware families. The function reference below preserves the upstream signatures and source links; helper functions do not all share the wrapper's arity.
Upstream function reference
Treats HEAD requests like GET requests while omitting the response body.
head-request
(head-request request)
Function.
Transforms a HEAD request into a GET request for handler execution. Source
head-response
(head-response response request)
Function.
Clears the response body when the original request method was HEAD. Source
wrap-head
(wrap-head handler)
Function.
Wraps a handler with HEAD request and response adjustments. Source