Closed jiripudil closed 7 months ago
Hi, I would like to contribute to this.
I can confirm that updating options.href
during redirect
event fixes the issue for me:
naja.redirectHandler.addEventListener('redirect', (event) => {
event.detail.options.href = event.detail.url;
});
Bug Report
When the server responds with a redirect that Naja follows asynchronously, the location is incorrectly updated to the original request's URL. I believe the culprit is this coalescing assignment, which preserves
href
from the first request.To fix this, I think
HistoryHandler
could listen to theredirect
event and updateoptions.href
to the redirected URL 🤔