mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-09-28 21:41:40 +00:00
Use raw attribute href on hx-boost (#1742)
This resolves a bug when file system URLs are used on Windows. It reverts part of a previous change where URLs were normalized prior to the request in order to reduce key collisions in the history cache. Because htmx's history cache is based entirely on response URLs, not request URLs, I am reasonably confident that reverting this line doesn't affect that optimization at all, but in any case it causes a bug which is more important.
This commit is contained in:
parent
d8f7afe5c4
commit
1763cfc64e
@ -1348,7 +1348,7 @@ return (function () {
|
||||
var verb, path;
|
||||
if (elt.tagName === "A") {
|
||||
verb = "get";
|
||||
path = elt.href; // DOM property gives the fully resolved href of a relative link
|
||||
path = getRawAttribute(elt, 'href')
|
||||
} else {
|
||||
var rawAttribute = getRawAttribute(elt, "method");
|
||||
verb = rawAttribute ? rawAttribute.toLowerCase() : "get";
|
||||
|
@ -101,7 +101,7 @@ describe("hx-disinherit attribute", function() {
|
||||
var link = byId("a1");
|
||||
link.click();
|
||||
// should match the fully resolved href of the boosted element
|
||||
should.equal(request.detail.requestConfig.path, request.detail.elt.href);
|
||||
should.equal(request.detail.requestConfig.path, '/test');
|
||||
should.equal(request.detail.elt["htmx-internal-data"].boosted, true);
|
||||
} finally {
|
||||
htmx.off("htmx:beforeRequest", handler);
|
||||
|
Loading…
x
Reference in New Issue
Block a user