    (fn [last-modified]
      (if-let [last-modified (round-seconds-up last-modified)]
 
-       (if-let [if-modified-since (some-> (:request ctx)
-                                          (get-in [:headers "if-modified-since"])
-                                          ring.util.time/parse-date)]
-
+       (if-let [if-modified-since
+                (some-> (:request ctx)
+                        (get-in [:headers "if-modified-since"])
+                        ring.util.time/parse-date)]
          (if (<=
               (.getTime last-modified)
               (.getTime if-modified-since))
 
            ;; exit with 304
            (d/error-deferred
-            (ex-info "" (merge {:status 304
-                                ::http-response true}
-                               ctx)))
+            (ex-info "" (merge {:status 304 ::http-response true} ctx)))
 
            (assoc-in ctx [:response :last-modified] (ring.util.time/format-date last-modified)))
 

      ;; Create a map of representation -> etag
      (-> ctx :http-resource :version?)
      (let [version (p/version (:resource ctx) ctx)
            etags (into {} (map (juxt identity (partial p/to-etag version)) (-> ctx :http-resource :representations)))]

        (if (empty? (set/intersection matches (set (vals etags))))
          (d/error-deferred

(defn if-match
  [ctx]

  (if-let [matches (some->> (get-in (:request ctx) [:headers "if-match"]) parse-csv set)]

    ;; We have an If-Match to process
    (cond
