                        :path patch
                        :trace (p/trace? trace? ctx)
                        :options (or allow-origin)
-                       nil)
-                     )
+                       nil))
                   (do
                     (warnf "Method not allowed %s" method)
                     (d/error-deferred

                                        ::http-response true}
                                       ctx)))

                   (assoc-in ctx [:response :headers "last-modified"] (format-date last-modified))

                   ))

               (do
                 (infof "No if-modified-since header: %s" (:headers req))

                     (rep/content-type-default state)))
               content-length (rep/content-length state)]

           (case method
             :head (if content-type
                     ;; We don't need to add Content-Length,
                     ;; Content-Range, Trailer or Tranfer-Encoding, as
                     ;; per rfc7231.html#section-3.3
                     (update-in ctx [:response :headers] assoc "content-type" content-type)
                     ctx)

             :get
             (d/chain

              ;; Determine body
              (cond
                body (p/body body ctx)
                state state       ; the state here can still be deferred
                )

              ;; serialize to representation (an existing string will be left intact)
              (fn [state]
                (rep/content state content-type))

              ;; on nil, compose default result (if in dev)
              #_(fn [x] (if x x (rep/content nil content-type)))

              (fn [body]
                (if (not= method :head)
                  (assoc-in ctx [:response :body] body)
                  ctx))

              (fn [ctx]
                (if content-type
                  (update-in ctx [:response :headers] assoc "content-type" content-type)
                  ctx
                  ))

              (fn [ctx]
                (if content-length
                  (update-in ctx [:response :headers] assoc "content-length" content-length)
                  ctx)))))))

      :post
      (d/chain
