Skip to content

Commit

Permalink
JSON Shallow Copy and CORS
Browse files Browse the repository at this point in the history
CORS filter was modified to work with CORS for Safari. CORS was
preventing synchronization on iPad devices. JSON Shallow Copy was
modified to return more fields needed for the client. (#5)
  • Loading branch information
littlefieldnick committed Aug 17, 2018
1 parent ac0bbe2 commit 405a1e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public static Location copyLocation(Location loc) {

LocationHierarchy level = new LocationHierarchy();
level.setExtId(loc.getLocationLevel().getExtId());
level.setLevel(loc.getLocationLevel().getLevel());
level.setName(loc.getLocationLevel().getName());
level.setExtId(loc.getLocationLevel().getExtId());
copy.setLocationLevel(level);
copy.setUuid(loc.getUuid());
copy.setExtId(loc.getExtId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public void doFilter(ServletRequest servletRequest, ServletResponse servletRespo
System.out.println("CORSFilter HTTP Request: " + request.getMethod());

// Authorize (allow) all domains to consume the content
((HttpServletResponse) servletResponse).addHeader("Access-Control-Allow-Origin", "* ");
((HttpServletResponse) servletResponse).addHeader("Access-Control-Allow-Headers","*");
((HttpServletResponse) servletResponse).addHeader("Access-Control-Allow-Origin", "*");
((HttpServletResponse) servletResponse).addHeader("Access-Control-Allow-Headers","Accept, Accept-Language, Authorization, Content-Language, Content-Type");
((HttpServletResponse) servletResponse).addHeader("Access-Control-Allow-Methods","GET, OPTIONS, HEAD, PUT, POST");

HttpServletResponse resp = (HttpServletResponse) servletResponse;
Expand Down

0 comments on commit 405a1e0

Please sign in to comment.