STORM-708. CORS support for STORM UI. Allow CORS to do POST.
Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/9c0581e2 Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/9c0581e2 Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/9c0581e2 Branch: refs/heads/master Commit: 9c0581e2f0c3ce534017c377e1c0ca206dc90634 Parents: 2c486b3 Author: Sriharsha Chintalapani <[email protected]> Authored: Sun Mar 29 21:32:38 2015 -0700 Committer: Sriharsha Chintalapani <[email protected]> Committed: Sun Mar 29 21:32:38 2015 -0700 ---------------------------------------------------------------------- storm-core/src/clj/backtype/storm/ui/core.clj | 3 ++- storm-core/src/clj/backtype/storm/ui/helpers.clj | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/storm/blob/9c0581e2/storm-core/src/clj/backtype/storm/ui/core.clj ---------------------------------------------------------------------- diff --git a/storm-core/src/clj/backtype/storm/ui/core.clj b/storm-core/src/clj/backtype/storm/ui/core.clj index a13fcf3..b8ecbe2 100644 --- a/storm-core/src/clj/backtype/storm/ui/core.clj +++ b/storm-core/src/clj/backtype/storm/ui/core.clj @@ -893,7 +893,8 @@ [data callback :serialize-fn to-json :status 200] {:status status :headers (merge {"Cache-Control" "no-cache, no-store" - "Access-Control-Allow-Origin" "*"} + "Access-Control-Allow-Origin" "*" + "Access-Control-Allow-Headers" "Content-Type, Access-Control-Allow-Headers, Access-Controler-Allow-Origin, X-Requested-By, X-Csrf-Token, Authorization, X-Requested-With"} (if (not-nil? callback) {"Content-Type" "application/javascript;charset=utf-8"} {"Content-Type" "application/json;charset=utf-8"})) :body (if (not-nil? callback) http://git-wip-us.apache.org/repos/asf/storm/blob/9c0581e2/storm-core/src/clj/backtype/storm/ui/helpers.clj ---------------------------------------------------------------------- diff --git a/storm-core/src/clj/backtype/storm/ui/helpers.clj b/storm-core/src/clj/backtype/storm/ui/helpers.clj index a7eb280..b54a46a 100644 --- a/storm-core/src/clj/backtype/storm/ui/helpers.clj +++ b/storm-core/src/clj/backtype/storm/ui/helpers.clj @@ -177,6 +177,7 @@ $(\"table#%s\").each(function(i) { $(this).tablesorter({ sortList: %s, headers: (.setInitParameter CrossOriginFilter/ALLOWED_ORIGINS_PARAM "*") (.setInitParameter CrossOriginFilter/ALLOWED_METHODS_PARAM "GET, POST, PUT") (.setInitParameter CrossOriginFilter/ALLOWED_HEADERS_PARAM "X-Requested-With, X-Requested-By, Access-Control-Allow-Origin, Content-Type, Content-Length, Accept, Origin") + (.setInitParameter CrossOriginFilter/ACCESS_CONTROL_ALLOW_ORIGIN_HEADER "*") )) (defn config-filter [server handler filters-confs]
