mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-10-16 14:35:43 -04:00
fix canonical URL edge case
This commit is contained in:
5 files changed
+46
-25
No files matched your search
@@ -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())
|
||||
|
||||
Reference in new issue
Block a user