From 40f3bc0de47cd1f47453b073e963d778acd40876 Mon Sep 17 00:00:00 2001 From: Teemu Patja Date: Mon, 30 Jan 2017 17:45:45 +0200 Subject: [PATCH] Move gzip middleware to a better place --- src/clj/commiteth/handler.clj | 5 ++--- src/clj/commiteth/middleware.clj | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/clj/commiteth/handler.clj b/src/clj/commiteth/handler.clj index e16f79f..1d94959 100644 --- a/src/clj/commiteth/handler.clj +++ b/src/clj/commiteth/handler.clj @@ -9,7 +9,6 @@ [compojure.route :as route] [ring.middleware.json :refer [wrap-json-params]] [ring.middleware.keyword-params :refer [wrap-keyword-params]] - [ring.middleware.gzip :refer [wrap-gzip]] [commiteth.env :refer [defaults]] [mount.core :as mount] [commiteth.middleware :as middleware])) @@ -35,5 +34,5 @@ :title "page not found"}))))) -(defn app [] (-> (middleware/wrap-base #'app-routes) - wrap-gzip)) +(defn app [] + (middleware/wrap-base #'app-routes)) diff --git a/src/clj/commiteth/middleware.clj b/src/clj/commiteth/middleware.clj index cd7151d..36be4dd 100644 --- a/src/clj/commiteth/middleware.clj +++ b/src/clj/commiteth/middleware.clj @@ -9,6 +9,7 @@ [ring.middleware.flash :refer [wrap-flash]] [immutant.web.middleware :refer [wrap-session]] [ring.middleware.defaults :refer [site-defaults wrap-defaults]] + [ring.middleware.gzip :refer [wrap-gzip]] [buddy.auth.middleware :refer [wrap-authentication wrap-authorization]] [buddy.auth.backends.session :refer [session-backend]] [buddy.auth.accessrules :refer [restrict]] @@ -91,4 +92,5 @@ (assoc-in [:security :anti-forgery] false) (dissoc :session))) wrap-context + wrap-gzip wrap-internal-error))