Skip to content

Commit

Permalink
added corsFilter to filter chain for default requests, tweak to cors …
Browse files Browse the repository at this point in the history
…filter
  • Loading branch information
George Nash authored and George Nash committed Nov 7, 2024
1 parent 98baf91 commit 9a02b31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse
if (request.getHeader("Access-Control-Request-Method") != null && "OPTIONS".equals(request.getMethod())) {
// CORS "pre-flight" request
response.addHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE");
response.addHeader("Access-Control-Allow-Headers", "X-Requested-With,Origin,Content-Type,Accept,Authorization,x-csrf-token");
response.addHeader("Access-Control-Allow-Headers", "X-Requested-With,Origin,Content-Type,Accept,Authorization,x-csrf-token,x-xsrf-token");
return;
}
}

Expand Down
1 change: 1 addition & 0 deletions orcid-web/src/main/resources/orcid-frontend-security.xml
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@
<sec:headers>
<sec:frame-options policy="SAMEORIGIN" />
</sec:headers>
<sec:custom-filter position="CORS_FILTER" ref="corsFilterWeb" />
<sec:custom-filter position="SWITCH_USER_FILTER" ref="switchUserProcessingFilter" />
<sec:intercept-url pattern="/"
access="IS_AUTHENTICATED_ANONYMOUSLY" />
Expand Down

0 comments on commit 9a02b31

Please sign in to comment.