From bef6c8470f424509bbd68f2b1a540f68664131ae Mon Sep 17 00:00:00 2001 From: "Thomas G. Kristensen" Date: Mon, 11 Jan 2021 11:33:34 +0100 Subject: [PATCH] Check for nil headers It is technically possible to return nil headers from a Ring response which will result in a NPE without this change. --- src/ring/middleware/gzip.clj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ring/middleware/gzip.clj b/src/ring/middleware/gzip.clj index 67f44e1..48b3395 100644 --- a/src/ring/middleware/gzip.clj +++ b/src/ring/middleware/gzip.clj @@ -35,7 +35,8 @@ (defn- unencoded-type? [headers] - (if (or (headers "Content-Encoding") (headers "content-encoding")) + (if (and headers + (or (headers "Content-Encoding") (headers "content-encoding"))) false true))