API reference

fast-twitch.middlewares.ssl

Complete generated reference for fast-twitch.middlewares.ssl

Usage and execution boundary

Combines HTTPS redirect and HSTS. Forwarded scheme handling belongs before this wrapper when a trusted reverse proxy terminates HTTPS. Configure explicit settings for the deployment.

(ns application.middleware
  (:require [fast-twitch.middlewares.ssl :as middleware]))

(defn handler [_]
  {:status 200 :headers {"content-type" "text/plain"} :body "Hello"})

(def app (middleware/wrap-ssl handler {:ssl-redirect? true :hsts? true}))

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.

Settings and defaults

Setting Meaning
:ssl-redirect? / :hsts? Enable the corresponding wrapper
:hsts Nested HSTS options
HSTS :max-age Default 31536000
HSTS :include-subdomains? / :preload? Optional flags

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

Redirects insecure traffic and adds strict transport security headers when configured.

hsts-response

(hsts-response response request)
(hsts-response response request options)

Function.

Adds a Strict-Transport-Security header to HTTPS responses. Source

wrap-hsts

(wrap-hsts handler)
(wrap-hsts handler options)

Function.

Wraps a handler so HTTPS responses include strict transport security metadata. Source

wrap-ssl

(wrap-ssl handler)
(wrap-ssl handler options)

Function.

Composes HTTPS redirect and strict transport security behavior from options. Source

wrap-ssl-redirect

(wrap-ssl-redirect handler)
(wrap-ssl-redirect handler _options)

Function.

Wraps a handler so non-HTTPS requests receive a permanent redirect. Source


Source revision a4eb73f96836d034c7a24fe09dc7d51e4c581f64

Built with Fast-Twitch · Integrant · Datastar

Search documentation

Search pages and API symbols

Start hereWelcome to Fast-TwitchRing HTTP applications and configured native clients and transports in ClojureScript.Start hereGetting startedCompile and run your first Fast-Twitch server.Core conceptsRequest & responseUnderstand the maps at the center of a Fast-Twitch application.Core conceptsRoutingMatch URL patterns and compose handlers.Core conceptsMiddlewareWrap handlers with focused request and response behavior.GuidesHTML & IntegrantCompose a UI system with Integrant and render Hiccup.