From 541713d73f60c0f1f01ca52589ad00d4dc6fe96b Mon Sep 17 00:00:00 2001 From: Rosco Kalis Date: Tue, 10 Jul 2018 12:55:08 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9BFixed=20slugs=20containing=20the=20?= =?UTF-8?q?word=20`amp`=20result=20in=20404s=20when=20serving=20the=20amp?= =?UTF-8?q?=20version=20(#9722)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes #9715 - changed the `urlWithoutSubdirectoryWithoutAmp` variable in the amp router to only match /amp or /amp/ at the end of the url string, instead of just matching any occurrence of /amp in the url string --- core/server/apps/amp/lib/router.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/server/apps/amp/lib/router.js b/core/server/apps/amp/lib/router.js index 00ac0f60ef..6351a58bec 100644 --- a/core/server/apps/amp/lib/router.js +++ b/core/server/apps/amp/lib/router.js @@ -33,7 +33,7 @@ function _renderer(req, res, next) { function getPostData(req, res, next) { req.body = req.body || {}; - const urlWithoutSubdirectoryWithoutAmp = res.locals.relativeUrl.match(/(.*?\/)amp/)[1]; + const urlWithoutSubdirectoryWithoutAmp = res.locals.relativeUrl.match(/(.*?\/)amp\/?$/)[1]; /** * @NOTE