0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

🐛Fixed slugs containing the word amp result in 404s when serving the amp version (#9722)

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
This commit is contained in:
Rosco Kalis 2018-07-10 12:55:08 +02:00 committed by Katharina Irrgang
parent 742eed99bd
commit 541713d73f

View file

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