You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by pt...@apache.org on 2016/07/21 16:27:13 UTC

[5/8] storm git commit: STORM-1890: use pure clojure to detect html files from root path

STORM-1890: use pure clojure to detect html files from root path


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/05a4d9df
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/05a4d9df
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/05a4d9df

Branch: refs/heads/master
Commit: 05a4d9df227c8b083177505ae131962e17e0e47b
Parents: 09c76f5
Author: Alessandro Bellina <ab...@yahoo-inc.com>
Authored: Wed Jul 13 20:47:14 2016 -0500
Committer: Alessandro Bellina <ab...@yahoo-inc.com>
Committed: Wed Jul 13 20:47:14 2016 -0500

----------------------------------------------------------------------
 storm-core/src/clj/org/apache/storm/ui/helpers.clj | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/05a4d9df/storm-core/src/clj/org/apache/storm/ui/helpers.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/ui/helpers.clj b/storm-core/src/clj/org/apache/storm/ui/helpers.clj
index 16e6a6a..ac1ecd1 100644
--- a/storm-core/src/clj/org/apache/storm/ui/helpers.clj
+++ b/storm-core/src/clj/org/apache/storm/ui/helpers.clj
@@ -22,7 +22,6 @@
   (:use [org.apache.storm config log])
   (:use [org.apache.storm.util :only [clojurify-structure defnk not-nil?]])
   (:use [clj-time coerce format])
-  (:import [org.apache.commons.lang StringUtils])
   (:import [org.apache.storm.generated ExecutorInfo ExecutorSummary]
            [org.apache.storm.ui UIHelpers]
            [org.apache.storm.metric StormMetricsRegistry])
@@ -57,7 +56,7 @@
       ;; check that the response is html and that the path is for a root page: a single / in the path 
       ;; then we know we don't want it cached (e.g. /index.html)
       (if (and (= content-type "text/html") 
-               (= 1 (StringUtils/countMatches uri "/")))
+               (= 1 (count (re-seq #"/" uri))))
         ;; response for html page in root directory, no-cache 
         (response/header res "Cache-Control" "no-cache")
         ;; else, carry on