From e3fe08ce9f6840b13d66f6a3132d6b81dcfd3b4f Mon Sep 17 00:00:00 2001 From: Bryce Date: Tue, 22 Oct 2024 00:12:55 -0700 Subject: [PATCH] gzip fixes. --- src/clj/auto_ap/server.clj | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/clj/auto_ap/server.clj b/src/clj/auto_ap/server.clj index 178aa4ec..dc086600 100644 --- a/src/clj/auto_ap/server.clj +++ b/src/clj/auto_ap/server.clj @@ -35,20 +35,23 @@ (defn gzip-handler [] -(GzipHandler.) - #_(doto (GzipHandler.) - (.setIncludedMimeTypes (into-array ["text/css" - "text/plain" - "text/javascript" - "text/csv" - "text/html" - "text/html;charset=utf-8" - "application/javascript" - "application/csv" - "application/edn" - "application/json" - "image/svg+xml"])) - (.setMinGzipSize 1024))) + (let [gz (GzipHandler.)] + (doto gz + (.setIncludedMethods (into-array ["GET" "POST" "PUT" "DELETE" "PATCH"])) + (.setIncludedMimeTypes (into-array ["text/css" + "text/*" + "text/plain" + "text/javascript" + "text/csv" + "text/html" + "text/html;charset=utf-8" + "application/javascript" + "application/csv" + "application/edn" + "application/json" + "image/svg+xml"])) + (.setMinGzipSize 1024)) + gz)) (defn configure-jetty [server] (let [stats-handler (StatisticsHandler.)