From 380a519b2da4db6c4ca68fc9fab140b840106557 Mon Sep 17 00:00:00 2001 From: Dominik Henneke Date: Wed, 7 Jul 2021 09:47:13 +0200 Subject: [PATCH] Add a warning to the deprecated non-eventsource sync endpoint Signed-off-by: Dominik Henneke --- plugins/techdocs-backend/src/service/router.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/techdocs-backend/src/service/router.ts b/plugins/techdocs-backend/src/service/router.ts index 8b189cff16..53f262ac6c 100644 --- a/plugins/techdocs-backend/src/service/router.ts +++ b/plugins/techdocs-backend/src/service/router.ts @@ -127,6 +127,9 @@ export async function createRouter({ await docsSynchronizer.doSync( () => { if (req.header('accept') !== 'text/event-stream') { + console.warn( + "The /sync/:namespace/:kind/:name endpoint but the call wasn't done by an EventSource. This behavior is deprecated and will be removed soon. Make sure to update the @backstage/plugin-techdocs package in the frontend to the latest version.", + ); return createHttpResponse(res); }