From c2720e1f10348c24c70df0d339dd9a773c1d77e6 Mon Sep 17 00:00:00 2001 From: restrry Date: Thu, 5 Sep 2019 09:45:17 +0200 Subject: [PATCH] disable router prefixing with pluginId to unblock plugin migration until new api and static resource services are available --- src/core/server/plugins/plugin_context.ts | 2 +- test/plugin_functional/plugins/core_plugin_b/server/plugin.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/server/plugins/plugin_context.ts b/src/core/server/plugins/plugin_context.ts index 3df5ebe6f5806..46432cbb0da75 100644 --- a/src/core/server/plugins/plugin_context.ts +++ b/src/core/server/plugins/plugin_context.ts @@ -113,7 +113,7 @@ export function createPluginSetupContext( null, plugin.opaqueId ), - createRouter: () => deps.http.createRouter(`/${plugin.name}`, plugin.opaqueId), + createRouter: () => deps.http.createRouter('', plugin.opaqueId), registerOnPreAuth: deps.http.registerOnPreAuth, registerAuth: deps.http.registerAuth, registerOnPostAuth: deps.http.registerOnPostAuth, diff --git a/test/plugin_functional/plugins/core_plugin_b/server/plugin.ts b/test/plugin_functional/plugins/core_plugin_b/server/plugin.ts index 0f99c2441cbf2..67c9120b1f2d9 100644 --- a/test/plugin_functional/plugins/core_plugin_b/server/plugin.ts +++ b/test/plugin_functional/plugins/core_plugin_b/server/plugin.ts @@ -29,7 +29,7 @@ declare module 'kibana/server' { export class CorePluginBPlugin implements Plugin { public setup(core: CoreSetup, deps: {}) { const router = core.http.createRouter(); - router.get({ path: '/', validate: false }, async (context, req, res) => { + router.get({ path: '/core_plugin_b/', validate: false }, async (context, req, res) => { if (!context.pluginA) return res.internalError({ body: 'pluginA is disabled' }); const response = await context.pluginA.ping(); return res.ok({ body: `Pong via plugin A: ${response}` });