   (:require [clojure.java.io :as io]
             [clojure.string :as string])
   (:import (java.io File InputStream FileInputStream)
+           (java.util Locale)
            (javax.servlet.http HttpServlet
                                HttpServletRequest
                                HttpServletResponse)))

  (reduce
    (fn [headers, ^String name]
      (assoc headers
        (.toLowerCase name)
        (->> (.getHeaders request name)
             (enumeration-seq)
             (string/join ","))))

   :uri                (.getRequestURI request)
   :query-string       (.getQueryString request)
   :scheme             (keyword (.getScheme request))
   :request-method     (keyword (.toLowerCase (.getMethod request) Locale/ENGLISH))
   :headers            (get-headers request)
   :content-type       (.getContentType request)
   :content-length     (get-content-length request)
