bigskysoftware / htmx

</> htmx - high power tools for HTML
https://htmx.org
Other
38.04k stars 1.29k forks source link

Relative paths are not working #1736

Open dulguun0225 opened 1 year ago

dulguun0225 commented 1 year ago

Something like hx-post="./" hx-delete="./5" are all going to the root URL.

danpalmer commented 11 months ago

Hey, I just hit this and have a trivial reproduction:

<!-- index.html -->
<html>
<body class="hx-boost">
  <a href="sub/page1.html">Go to page</a>
</body>
<html>
<!-- sub/page1.html -->
<html>
<body class="hx-boost">
  <img src="img.png">
</body>
<html>

Requires an image at sub/img.png.

Following the boosted link from /index.html will result in a 404 of /img.png, where the request should have been to /sub/img.png.

My assumption is that anything in the content of the navigation target will be swapped in at the wrong time and the browser will make the correct requests based on the order of operations, but not the requests the user is expecting.

danpalmer commented 11 months ago

Similar to #1476