Permalink
Browse files

Add more headers settings to response.

  • Loading branch information...
1 parent 85b8e01 commit b8330b23069bf1d47247337fa2cabd679a3c3059 @shsu committed Feb 24, 2014
Showing with 10 additions and 4 deletions.
  1. +10 −4 src/main/java/ca/bcit/infosys/comp4911/helper/SH.java
@@ -13,13 +13,19 @@
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-Origin", "*")
- .build();
+ return javax.ws.rs.core.Response.status(code).
+ header("Access-Control-Allow-Origin", "*").
+ header("Access-Control-Allow-Methods","GET, POST, PUT, DELETE").
+ header("Access-Control-Allow-Headers","x-requested-with").
+ 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-Origin", "*")
- .build();
+ return javax.ws.rs.core.Response.status(code).entity(entity).
+ header("Access-Control-Allow-Origin", "*").
+ header("Access-Control-Allow-Methods","GET, POST, PUT, DELETE").
+ header("Access-Control-Allow-Headers","x-requested-with").
+ build();
}
public static String processHeaderQueryToken(final String headerToken, final String queryToken) {

0 comments on commit b8330b2

Please sign in to comment.