Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
how to force https traffic in clojure web app
(defn https-url [request-url]
(str (str (str (str "https://" (:server-name request-url) ":") "443")) (:uri request-url)))
(defn require-https
(fn [request]
(if (= (:scheme request) :http)
(ring.util.response/redirect (https-url request))
(handler request))))
(def war-handler
(-> app
(wrap-resource "public")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment