wimdeblauwe / htmx-spring-boot

Spring Boot and Thymeleaf helpers for working with htmx
Apache License 2.0
423 stars 41 forks source link

Use setHeader() instead of addHeader() to avoid multiple headers being set #92

Closed johannesg closed 7 months ago

johannesg commented 7 months ago

For some reason that I haven't figured out, the authentication entrypoint is called twice for me whenever a user isn't logged. Since the entrypoint uses addHeader() it will result in two HX-Refresh headers in the response, making htmx ignore the header.

Even though there's probably something wrong with my code, changing it to use setHeader() will work around this and make sure there is only one HX-Refresh header in the response, making htmx behave as it should.

And thank you for a great library!

wimdeblauwe commented 6 months ago

3.2.0 is now released with this fix.