bigskysoftware / bigskysoftware/htmx

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

Open
#3,045 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
49.4k
Forks
1.7k
Avg merge
3d 22h
Merged PRs (30d)
30

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.