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:
@@ -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