htmx icon indicating copy to clipboard operation
htmx copied to clipboard

Chained `HX-Location` responses pushes the urls in reverse.

Open bolu61 opened this issue 1 year ago • 0 comments

When chaining HX-Location redirects, the urls are pushed in reverse order.

In handleAjaxResponse, which is also called when the next request started by ajaxHelper resolves: https://github.com/bigskysoftware/htmx/blob/24fb2fe5227023f9940dbf8b6dea3a76e6f1cc07/src/htmx.js#L4645-L4647

Each request's promise only resolves when the request started by the redirect is resolved. So the newer request will have pushed it's url before the request that started the redirection pushes its url.

Url should be pushed before the handling the next response.

bolu61 avatar Nov 28 '24 09:11 bolu61