Liking cljdoc? Tell your friends :D

Default Interceptors

Pedestal provides a "default set" of interceptors when using the api:with-default-interceptors[ns=io.pedestal.channel] function.

These are presented in the order that they appear in the interceptor vector. That means their :enter functions will be called in the order they appear in this document, and their :leave functions are called in reverse order.

The following identifies the interceptor by their var or function, in the order they may be added by with-default-interceptors.

api:log-request[]

Logs each request at info level. See logging.adoc to configure loggers and logging levels.

api:allow-origin[ns=io.pedestal.http.cors]

Added only when the options include :allowed-origins.

api:not-found[]

Provides a 404 Not Found response when not :response is yet added to the context map; typically because the incoming request could not be matched to a route.

api:session[ns=io.pedestal.http.ring-middlewares]

Adds support for per-client session tracking; added to the connector map when :session-options are provided.

api:content-type[ns=io.pedestal.http.ring-middlewares]

Applies a Content-Type header to a response if missing by mapping the file name extension in the request’s URI.

api:query-params[ns=io.pedestal.http.route]

Parses the :query-string into the :query-params map added to the request.

api:secure-headers[ns=io.pedestal.http.secure-headers]

Adds security-related headers to the outgoing response.

with-default-interceptors is intended as scaffolding; a Pedestal application should replace the call to with-default-interceptors with the exact interceptors it requires, configured according the application’s needs.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close