       :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

                           file-path-separator
                           topo-id
                           file-path-separator
                           port))
           files (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)))))]
       (if (.exists dir)
         (if (or (blank? (*STORM-CONF* UI-FILTER))
               (authorized-log-user? user "worker.log" *STORM-CONF*))
           (html4
             [:head
              [:title "File Dumps - Storm Log Viewer"]

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