    (-> handler
        ring.keyword-params/wrap-keyword-params
        ring.params/wrap-params
-       (auth/wrap-basic-authentication authenticated?)
+       (auth/wrap-basic-authentication authenticated?))})
        ;redirect-http-to-https-if-required
        ;restrict-remote-access
-       )})
+
 
 (defn get-port
   [default]

      (hiccup-to-plain-text email-hiccup)
      (hiccup/html email-hiccup))))

(defn handle-completion!
  [aws-cred filename params]
  (log/info "Completed export computation for filename" filename "params:" (with-out-str (str params)))
  (upload-to-aws aws-cred filename)
  (notify-mongo filename "complete" params)
  (when (:email params) (send-email-notification! filename params)))

(defn handle-timedout-datadump!
  [aws-cred filename compute-chan params]

     [:p "Thanks for using " polis-link "!"]
     [:p "Christopher Small" [:br] "Chief Data Scientist"]]))


;(defn send-email!
;  ([{:keys [from to subject text html] :as params}]
;   (log/info "Sending email to:" to)
;   (log/debug "  have mailgun key?" (boolean *mailgun-key*))
;   (try
;     (client/post *mailgun-url*
;                  {:basic-auth ["api" *mailgun-key*]
;                   :headers {"host" "pol.is"}
;                   :query-params params})
;     (catch Exception e (.printStackTrace e))))
;  ([from to subject text html] (send-email! {:from from :to to :subject subject :text text :html html}))
;  ([from to subject text] (send-email! {:from from :to to :subject subject :text text})))


(defn send-email-notification-via-mailgun!
  "This is the old implementation of the send method, which directly sends an email using the mailgun AP.
  It will likely be removed soon but is being left here for posterity, for the moment."
  [filename params]
  (let [zinvite (:zinvite params)
        download-url (public-datadump-url filename zinvite)
