You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by bz...@apache.org on 2016/05/28 13:44:18 UTC

incubator-zeppelin git commit: Refactor CORS filter into webapp context handler

Repository: incubator-zeppelin
Updated Branches:
  refs/heads/master 6546defcd -> 215447693


Refactor CORS filter into webapp context handler

### What is this PR for?
#867 was a hotfix and merged immediately. However we can refactor CORS filter into more appropriate place, which is webapp context handler instead of keeping it in rest api handler (since it also applies to websocket api).

### What type of PR is it?
Refactoring

### Todos
* [x] - move from rest to webapp

### What is the Jira issue?

### How should this be tested?
Basically this is refactoring, and original flow holds.
For testing, can use same routine as in #867.

### Screenshots (if appropriate)

### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No

Author: Khalid Huseynov <kh...@nflabs.com>

Closes #900 from khalidhuseynov/fix/refactor-cors-filter and squashes the following commits:

210a613 [Khalid Huseynov] move cors filter from rest api to webapp handler


Project: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/commit/21544769
Tree: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/tree/21544769
Diff: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/diff/21544769

Branch: refs/heads/master
Commit: 215447693a402874788f2a16dd96224d14c3f349
Parents: 6546def
Author: Khalid Huseynov <kh...@nflabs.com>
Authored: Thu May 19 11:42:43 2016 +0900
Committer: Alexander Bezzubov <bz...@apache.org>
Committed: Sat May 28 22:44:06 2016 +0900

----------------------------------------------------------------------
 .../main/java/org/apache/zeppelin/server/ZeppelinServer.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/21544769/zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java b/zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java
index 1730457..c8fc60a 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java
@@ -232,9 +232,6 @@ public class ZeppelinServer extends Application {
     webapp.setSessionHandler(new SessionHandler());
     webapp.addServlet(cxfServletHolder, "/api/*");
 
-    webapp.addFilter(new FilterHolder(CorsFilter.class), "/*",
-        EnumSet.allOf(DispatcherType.class));
-
     webapp.setInitParameter("shiroConfigLocations",
         new File(conf.getShiroPath()).toURI().toString());
 
@@ -268,6 +265,9 @@ public class ZeppelinServer extends Application {
     webApp.addServlet(new ServletHolder(new DefaultServlet()), "/*");
     contexts.addHandler(webApp);
 
+    webApp.addFilter(new FilterHolder(CorsFilter.class), "/*",
+        EnumSet.allOf(DispatcherType.class));
+
     return webApp;
 
   }