     :root       - the root prefix path of the resources, defaults to 'public'
     :mime-types - an optional map of file extensions to mime types"
   [path & [options]]
-  (-> (GET (add-wildcard path) {{resource-path :*} :route-params}
-        (let [root (:root options "public")]
-          (resource-response (str root "/" resource-path))))
-      (wrap-content-type options)))
+  (GET (add-wildcard path) {{resource-path :*} :route-params}
+    (let [root (:root options "public")]
+      (some-> (resource-response (str root "/" resource-path))
+              (add-mime-type resource-path options)))))
 
 (defn not-found
   "A route that returns a 404 not found response, with its argument as the

    :root       - the root path where the files are stored, defaults to 'public'
    :mime-types - an optional map of file extensions to mime types"
  [path & [options]]
  (-> (GET (add-wildcard path) {{file-path :*} :route-params}
        (let [options (merge {:root "public"} options)]
          (file-response file-path options)))
      (wrap-content-type options)))

(defn resources
  "A route for serving resources on the classpath. Accepts the following

  "Route functions that define common behavior."
  (:require [compojure.response :as response]
            [compojure.core :refer [GET rfn]]
            [ring.util.mime-type :as mime]
            [ring.util.response :refer [file-response resource-response
                                        status content-type]]))

(defn- add-wildcard [^String path]
  (str path (if (.endsWith path "/") "*" "/*")))

(defn- add-mime-type [response path options]
  (if-let [mime-type (mime/ext-mime-type path (:mime-types options {}))]
    (content-type response mime-type)
    response))

(defn files
  "A route for serving static files from a directory. Accepts the following
