Skip to content

Instantly share code, notes, and snippets.

@bahulneel
Created March 4, 2016 10:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bahulneel/87ed9a13eeada08e93e7 to your computer and use it in GitHub Desktop.
Save bahulneel/87ed9a13eeada08e93e7 to your computer and use it in GitHub Desktop.
(defn wrap-save-content [handler content-type]
(fn [request]
(if (= content-type (get-in request [:headers "Content-Type"]))
(let [temp-file (clojure.java.io/file ...)]
(copy (:body request) temp-file)
(handler (assoc request :body temp-file)))
(handler request))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment