Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix bug in CorsFilter

Change-Id: I144bdf96842dd6204e5eccbb3a7ca4f4dceb7143
  • Loading branch information...
commit ceb7406afe315dad35429970d3b8ab3357bf4c33 1 parent a7c30cd
@dsyer dsyer authored
View
8 samples/api/src/main/java/org/cloudfoundry/identity/api/web/CorsFilter.java
@@ -24,17 +24,17 @@
public class CorsFilter extends OncePerRequestFilter {
- @Override
+ @Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
throws ServletException, IOException {
response.addHeader("Access-Control-Allow-Origin", "*");
- if (request.getHeader("Access-Control-Request-Method") != null && "OPTIONS".equals(request.getMethod())); {
+ 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", "Authorization");
response.addHeader("Access-Control-Max-Age", "1728000");
+ } else {
+ filterChain.doFilter(request, response);
}
- filterChain.doFilter(request, response);
}
-
}
Please sign in to comment.
Something went wrong with that request. Please try again.