Skip to content

Commit

Permalink
remove HAPI plugins registration from legacy (#94262)
Browse files Browse the repository at this point in the history
* remove HAPI plugins registration from legacy

* remove duplicate legacy integration tests
  • Loading branch information
pgayvallet authored Mar 10, 2021
1 parent 066e47e commit 00fcc2d
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 106 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@
"@hapi/hoek": "^9.1.1",
"@hapi/inert": "^6.0.3",
"@hapi/podium": "^4.1.1",
"@hapi/vision": "^6.0.1",
"@hapi/wreck": "^17.1.0",
"@kbn/ace": "link:packages/kbn-ace",
"@kbn/analytics": "link:packages/kbn-analytics",
Expand Down
11 changes: 3 additions & 8 deletions src/legacy/server/http/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,10 @@
import { format } from 'url';
import Boom from '@hapi/boom';

import { registerHapiPlugins } from './register_hapi_plugins';
import { setupBasePathProvider } from './setup_base_path_provider';

export default async function (kbnServer, server) {
server = kbnServer.server;

setupBasePathProvider(kbnServer);

await registerHapiPlugins(server);
const getBasePath = (request) => kbnServer.newPlatform.setup.core.http.basePath.get(request);

server.route({
method: 'GET',
Expand All @@ -27,8 +22,8 @@ export default async function (kbnServer, server) {
if (path === '/' || path.charAt(path.length - 1) !== '/') {
throw Boom.notFound();
}

const pathPrefix = req.getBasePath() ? `${req.getBasePath()}/` : '';
const basePath = getBasePath(req);
const pathPrefix = basePath ? `${basePath}/` : '';
return h
.redirect(
format({
Expand Down
52 changes: 0 additions & 52 deletions src/legacy/server/http/integration_tests/max_payload_size.test.js

This file was deleted.

21 changes: 0 additions & 21 deletions src/legacy/server/http/register_hapi_plugins.js

This file was deleted.

14 changes: 0 additions & 14 deletions src/legacy/server/http/setup_base_path_provider.js

This file was deleted.

10 changes: 0 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2016,16 +2016,6 @@
dependencies:
"@hapi/hoek" "9.x.x"

"@hapi/vision@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/@hapi/vision/-/vision-6.0.1.tgz#976c3575be56d3cb5b472ddcfe0b7403778706fd"
integrity sha512-xv4PwmhbXCLzDfojZ7l4+P/YynBhMInV8GtLPH4gB74prhwOl8lGcJxxK8V9rf1aMH/vonM5yVGd9FuoA9sT0A==
dependencies:
"@hapi/boom" "9.x.x"
"@hapi/bounce" "2.x.x"
"@hapi/hoek" "9.x.x"
"@hapi/validate" "1.x.x"

"@hapi/[email protected]", "@hapi/wreck@^17.0.0", "@hapi/wreck@^17.1.0":
version "17.1.0"
resolved "https://registry.yarnpkg.com/@hapi/wreck/-/wreck-17.1.0.tgz#fbdc380c6f3fa1f8052dc612b2d3b6ce3e88dbec"
Expand Down

0 comments on commit 00fcc2d

Please sign in to comment.