       :headers {"Access-Control-Allow-Origin" origin
                 "Access-Control-Allow-Credentials" "true"})))
 
+(defn get-profiler-dump-files
+  [dir]
+  (filter (comp not nil?)
+        (for [f (.listFiles dir)]
+          (let [name (.getName f)]
+            (if (or
+                  (.endsWith name ".txt")
+                  (.endsWith name ".jfr")
+                  (.endsWith name ".bin"))
+              (.getName f))))))
+
 (defroutes log-routes
   (GET "/log" [:as req & m]
     (try

              (include-css "/css/style.css")]
             [:body
              [:ul
               (for [file files]
                 [:li
                  [:a {:href (str "/dumps/" topo-id "/" host-port "/" file)} file ]])]])
           (unauthorized-user-html user))

        (ring-response-from-exception ex))))
  (GET "/dumps/:topo-id/:host-port/:filename"
       [:as {:keys [servlet-request servlet-response log-root]} topo-id host-port filename &m]
     (let [user (.getUserName http-creds-handler servlet-request)
           port (second (split host-port #":"))
           dir (File. (str log-root
                           file-path-separator
                           topo-id
                           file-path-separator
                           port))
           file (File. (str log-root
                            file-path-separator
                            topo-id
                            file-path-separator
                            port
                            file-path-separator
                            filename))]
       (if (and (.exists dir) (.exists file))
         (if (or (blank? (*STORM-CONF* UI-FILTER))
               (authorized-log-user? user 
                                     (str topo-id file-path-separator port file-path-separator "worker.log")
                                     *STORM-CONF*))
           (-> (resp/response file)
               (resp/content-type "application/octet-stream"))
           (unauthorized-user-html user))
         (-> (resp/response "Page not found")
           (resp/status 404)))))
  (GET "/dumps/:topo-id/:host-port"
       [:as {:keys [servlet-request servlet-response log-root]} topo-id host-port &m]
     (let [user (.getUserName http-creds-handler servlet-request)
