File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
omod/src/main/java/org/openmrs/module/smartonfhir/web/filter Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 23
23
* To use this declare filter mapping in config.xml
24
24
*/
25
25
public class CORSFilter extends OncePerRequestFilter {
26
-
26
+
27
27
@ Override
28
28
protected void doFilterInternal (HttpServletRequest request , HttpServletResponse response , FilterChain filterChain )
29
- throws ServletException , IOException {
29
+ throws ServletException , IOException {
30
30
// CORS "pre-flight" request
31
31
response .addHeader ("Access-Control-Allow-Credentials" , "true" );
32
32
response .addHeader ("Access-Control-Allow-Methods" , " OPTIONS" );
33
33
response .addHeader ("Access-Control-Allow-Headers" , "Authorization" );
34
34
response .addHeader ("Access-Control-Allow-Headers" , "Content-Type" );
35
35
response .addHeader ("Access-Control-Allow-Origin" , "*" );
36
36
response .addHeader ("Access-Control-Max-Age" , "1" );
37
-
37
+
38
38
if ("OPTIONS" .equalsIgnoreCase (request .getMethod ())) {
39
39
response .setStatus (HttpServletResponse .SC_OK );
40
40
return ;
41
41
}
42
-
42
+
43
43
filterChain .doFilter (request , response );
44
44
}
45
45
}
You can’t perform that action at this time.
0 commit comments