Commit 9fc25ed4 authored by Matija Obreza's avatar Matija Obreza

Jetty CORS

parent 53009221
......@@ -503,6 +503,12 @@
<version>0.1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlets</artifactId>
<version>9.1.3.v20140225</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
......
......@@ -55,6 +55,45 @@
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- Cross origin for web REST API clients -->
<filter>
<filter-name>cross-origin</filter-name>
<filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
<!-- <init-param>
<param-name>allowedOrigins</param-name>
<param-value>*</param-value>
</init-param> -->
<!-- <init-param>
<param-name>allowCredentials</param-name>
<param-value>true</param-value>
</init-param>
-->
<init-param>
<param-name>allowedMethods</param-name>
<param-value>GET,POST,PUT,DELETE</param-value>
</init-param>
<init-param>
<param-name>allowedHeaders</param-name>
<param-value>authorization</param-value>
</init-param>
<!-- Do not chain preflight request to application -->
<init-param>
<param-name>chainPreflight</param-name>
<param-value>false</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>cross-origin</filter-name>
<url-pattern>/oauth/token</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>cross-origin</filter-name>
<url-pattern>/api/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>hazelcastWebFilter</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
......@@ -95,7 +134,7 @@
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>mvc</servlet-name>
<servlet-class>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment