Open Secret-chest opened 1 month ago
Hey,
What browser are you using? For ex in this JSFiddle, on Chrome, I correctly get the Accept-Language
header set.
As a workaround, I think you chould manually set the Accept-Language
header in a global htmx:configRequest
event handler, this could be an easy way to add this header for all of your requests with a few lines of JS.
what is the safe way to send a session cookie to AJAX as well
Similarly, as far as I know, cookies are normally automatically carried around and sent along every request you make, whether those are htmx requests or standard ones. If it doesn't happen for you, would you mind providing a reproducible example, to be able to investigate the issue?
I am using Chromium.
My app is Flask. Could it be that the cookie is HTTP-only?
Making it HTTP-only should simply not expose it to the JS (using document.cookie
), but they should still be sent along the requests that htmx makes. After all, htmx doesn't manipulate the cookies by itself, it's the browser that adds them to any outgoing request.
Does it happen on other browsers for you as well? Or just Chromium?
When I use an AJAX call to replace a row the new row shows in English, since my app uses
Accept-Language
to decide what to show. Additionally, what is the safe way to send a session cookie to AJAX as well?