diff --git a/core/server/web/api/canary/admin/routes.js b/core/server/web/api/canary/admin/routes.js index 256d47318b..85c1220a2e 100644 --- a/core/server/web/api/canary/admin/routes.js +++ b/core/server/web/api/canary/admin/routes.js @@ -244,7 +244,7 @@ module.exports = function apiRoutes() { apiMw.upload.mediaValidation({type: 'media'}), http(api.media.upload) ); - router.put('/media/thumbnail/', + router.put('/media/thumbnail/upload', labs.enabledMiddleware('mediaAPI'), mw.authAdminApi, apiMw.upload.single('file'), diff --git a/test/e2e-api/admin/media.test.js b/test/e2e-api/admin/media.test.js index e30a401823..d3414f21ec 100644 --- a/test/e2e-api/admin/media.test.js +++ b/test/e2e-api/admin/media.test.js @@ -86,7 +86,7 @@ describe('Media API', function () { }); }); - describe('media/thumbnail/:url', function () { + describe('media/thumbnail/upload', function () { it('Can update existing thumbnail', async function () { const res = await request.post(localUtils.API.getApiQuery('media/upload')) .set('Origin', config.get('url')) @@ -102,7 +102,7 @@ describe('Media API', function () { media.push(res.body.media[0].url.replace(config.get('url'), '')); media.push(res.body.media[0].thumbnail_url.replace(config.get('url'), '')); - const thumbnailRes = await request.put(localUtils.API.getApiQuery(`media/thumbnail/`)) + const thumbnailRes = await request.put(localUtils.API.getApiQuery(`media/thumbnail/upload`)) .set('Origin', config.get('url')) .expect('Content-Type', /json/) .field('url', res.body.media[0].url) @@ -127,7 +127,7 @@ describe('Media API', function () { media.push(res.body.media[0].url.replace(config.get('url'), '')); - const thumbnailRes = await request.put(localUtils.API.getApiQuery(`media/thumbnail/`)) + const thumbnailRes = await request.put(localUtils.API.getApiQuery(`media/thumbnail/upload`)) .set('Origin', config.get('url')) .expect('Content-Type', /json/) .field('url', res.body.media[0].url)