diff --git a/core/server/web/api/v2/admin/middleware.js b/core/server/web/api/v2/admin/middleware.js index 8242eec88b..818c864329 100644 --- a/core/server/web/api/v2/admin/middleware.js +++ b/core/server/web/api/v2/admin/middleware.js @@ -19,7 +19,7 @@ const notImplemented = function (req, res, next) { themes: ['POST'] }; - const match = req.url.match(/^\/(\w+)\//); + const match = req.url.match(/^\/(\w+)\/?/); if (match) { const entity = match[1]; diff --git a/core/test/acceptance/old/admin/key_authentication_spec.js b/core/test/acceptance/old/admin/key_authentication_spec.js index 9697fc0bb5..d4ff4dc659 100644 --- a/core/test/acceptance/old/admin/key_authentication_spec.js +++ b/core/test/acceptance/old/admin/key_authentication_spec.js @@ -60,7 +60,7 @@ describe('Admin API V2 key authentication', function () { }; return request - .post(localUtils.API.getApiQuery('posts')) + .post(localUtils.API.getApiQuery('posts/')) .set('Origin', config.get('url')) .set('Authorization', `Ghost ${localUtils.getValidAdminToken(localUtils.API.getApiQuery('posts'))}`) .send({ @@ -68,6 +68,6 @@ describe('Admin API V2 key authentication', function () { }) .expect('Content-Type', /json/) .expect('Cache-Control', testUtils.cacheRules.private) - .expect(501); + .expect(201); }); });