From 6b86774e9eb1ed9ee496df5d237eb803854c4ec8 Mon Sep 17 00:00:00 2001 From: Partha Mandal <43367843+partham16@users.noreply.github.com> Date: Thu, 29 Oct 2020 23:55:18 +0000 Subject: [PATCH] Issue #58 : Update `getPage()` to have `.slice(1)` Currently `getPage` returns `location.pathname.slice(-32)` This raises `slug` to not found when the pathname is longer --- worker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker.js b/worker.js index b26a381..4fa53a0 100644 --- a/worker.js +++ b/worker.js @@ -219,7 +219,7 @@ class BodyRewriter { PAGE_TO_SLUG[page] = slug; }); function getPage() { - return location.pathname.slice(-32); + return location.pathname.slice(1); } function getSlug() { return location.pathname.slice(1);