Skip to content

Commit

Permalink
Allow only one origin
Browse files Browse the repository at this point in the history
  • Loading branch information
nagpalkaran95 authored and francisf committed Dec 1, 2022
1 parent b81c677 commit 61c73da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,10 @@ public void init(FilterConfig filterConfig) throws ServletException {
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
HttpServletRequest req = (HttpServletRequest) request;
String origin = req.getHeader("Origin");
HttpServletResponse resp = (HttpServletResponse) response;

resp.addHeader("Access-Control-Allow-Credentials", "true");
resp.addHeader("Access-Control-Allow-Origin", "*");
resp.addHeader("Access-Control-Allow-Origin", "https://observability.browserstack.com");
resp.addHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT");
resp.addHeader("Access-Control-Allow-Headers", "*");
resp.addHeader("Access-Control-Expose-Headers", "*");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
Expand Down

0 comments on commit 61c73da

Please sign in to comment.