1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-06-29 23:45:58 -04:00

fix canonical URL edge case

This commit is contained in:
2021-10-03 12:28:27 -04:00
parent 013550c1f9
commit bb8e5e2248
5 changed files with 46 additions and 25 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ if (wrapper && canonical) {
wrapper.style.display = "inline-flex";
// get path and strip beginning and ending forward slash
const slug = urlParse(canonical.href).pathname.replace(/^\/|\/$/g, "");
const slug = urlParse(canonical).pathname.replace(/^\/|\/$/g, "");
fetch(`/api/hits/?slug=${encodeURIComponent(slug)}`)
.then((response) => response.json())