Skip to content

Commit

Permalink
Handle also lower-case cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
samie committed Jul 25, 2024
1 parent 1d39f9a commit 9bfb790
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/com/example/application/CORSFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.springframework.core.annotation.Order;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;

@WebFilter(filterName = "Vaadin CORS Filter", asyncSupported = true, urlPatterns = "/*")
Expand Down Expand Up @@ -39,7 +40,9 @@ public void doFilter(HttpServletRequest request, HttpServletResponse response, F
}
filterChain.doFilter(request, response);

Collection<String> cookieHeaders = response.getHeaders("Set-Cookie");
Collection<String> cookieHeaders = new ArrayList<>();
cookieHeaders.addAll(response.getHeaders("Set-Cookie"));
cookieHeaders.addAll(response.getHeaders("set-cookie"));
cookieHeaders.stream()
.filter(c -> c.startsWith("JSESSIONID="))
.findFirst()
Expand Down

0 comments on commit 9bfb790

Please sign in to comment.