Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Tweak cors filter settings and remove our "hack filter"

  • Loading branch information...
commit 9d856e558b025f946810617db9ed091d313c160c 1 parent 2e8f007
@shsu authored
View
2  pom.xml
@@ -114,7 +114,7 @@
<dependency>
<groupId>com.thetransactioncompany</groupId>
<artifactId>cors-filter</artifactId>
- <version>1.9</version>
+ <version>1.9.2</version>
</dependency>
</dependencies>
<repositories>
View
10 src/main/java/ca/bcit/infosys/comp4911/helper/SH.java
@@ -13,17 +13,11 @@
public static final String TOKEN = "token";
public static javax.ws.rs.core.Response corsResponse(Integer code) {
- return javax.ws.rs.core.Response.status(code).
- header("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS, X-XSRF-TOKEN").
- header("Access-Control-Max-Age",3600).
- build();
+ return javax.ws.rs.core.Response.status(code).build();
}
public static javax.ws.rs.core.Response corsResponseWithEntity(Integer code, Object entity) {
- return javax.ws.rs.core.Response.status(code).entity(entity).
- header("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS, X-XSRF-TOKEN").
- header("Access-Control-Max-Age",3600).
- build();
+ return javax.ws.rs.core.Response.status(code).entity(entity).build();
}
public static String processHeaderQueryToken(final String headerToken, final String queryToken) {
View
8 src/main/webapp/WEB-INF/web.xml
@@ -6,12 +6,12 @@
<filter-name>CORS</filter-name>
<filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>
<init-param>
- <param-name>cors.allowOrigin</param-name>
- <param-value>*</param-value>
+ <param-name>cors.supportedMethods</param-name>
+ <param-value>GET, POST, PUT, DELETE, OPTIONS</param-value>
</init-param>
<init-param>
- <param-name>cors.supportedHeaders</param-name>
- <param-value>*</param-value>
+ <param-name>cors.maxAge</param-name>
+ <param-value>3600</param-value>
</init-param>
</filter>
<filter-mapping>
Please sign in to comment.
Something went wrong with that request. Please try again.