From ea312c849d72e83a794db9f9efd78b3bfb3d2907 Mon Sep 17 00:00:00 2001 From: Johannes Gustafsson Date: Sun, 19 Nov 2023 11:06:46 +0100 Subject: [PATCH] Use setHeader() instead of addHeader() to avoid multiple headers --- .../boot/security/HxRefreshHeaderAuthenticationEntryPoint.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htmx-spring-boot/src/main/java/io/github/wimdeblauwe/htmx/spring/boot/security/HxRefreshHeaderAuthenticationEntryPoint.java b/htmx-spring-boot/src/main/java/io/github/wimdeblauwe/htmx/spring/boot/security/HxRefreshHeaderAuthenticationEntryPoint.java index 0bfa474..4819935 100644 --- a/htmx-spring-boot/src/main/java/io/github/wimdeblauwe/htmx/spring/boot/security/HxRefreshHeaderAuthenticationEntryPoint.java +++ b/htmx-spring-boot/src/main/java/io/github/wimdeblauwe/htmx/spring/boot/security/HxRefreshHeaderAuthenticationEntryPoint.java @@ -25,7 +25,7 @@ public HxRefreshHeaderAuthenticationEntryPoint() { @Override public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException { - response.addHeader("HX-Refresh", "true"); + response.setHeader("HX-Refresh", "true"); forbiddenEntryPoint.commence(request, response, authException); } }