                                         ::http-response true}
                                        ctx)))
 
-                   (assoc-in ctx [:response :headers "last-modified"] (format-date last-modified))
-
-                   ))
+                   (assoc-in ctx [:response :headers "last-modified"] (format-date last-modified))))
 
                (do
                  (infof "No if-modified-since header: %s" (:headers req))

                            [:body
                             [:h1 "Internal Server Error"]
                             [:p (str %)]
                             [:pre (with-out-str (apply str (interpose "\n" (seq (.getStackTrace %)))))]
                             ])}))))))))


;; TODO: pets should return resource-metadata with a (possibly deferred) model

;; handle-method-not-allowed 405 "Method not allowed."

;; This is OK
;; ((api-handler api) (mock/request :get "/persons"))

;; This is should yield 405 "Method not allowed."
;; ((api-handler api) (mock/request :get "/persons"))

;; List of interesting things to do

;; There should be a general handler that does the right thing
;; wrt. available methods (Method Not Allowed) and calls out to
;; callbacks accordingly. Perhaps there's no sense in EVERYTHING being
;; overridable, as with Liberator. It should hard-code the things that
;; don't make sense to override, and use hooks for the rest.

;; Resource existence is most important - and not covered by swagger, so it's a key hook.

;; Return deferreds, if necessary, if the computation is length to compute (e.g. for exists? checks)

;; CORS support: build this in, make allow-origin first-class, which headers should be allowed should be a hook (with default)


(defn yada [& args]
  (if (keyword? (first args))

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