diff --git a/lib/plugin.js b/lib/plugin.js index 68f2614..675f99b 100644 --- a/lib/plugin.js +++ b/lib/plugin.js @@ -153,18 +153,6 @@ exports.register = function (server, opts, next) { } }) - server.ext('onPreHandler', function (request, reply) { - var routeSettingsForHarvester = request.route.settings.plugins.harvester - if (routeSettingsForHarvester) { - const before = routeSettingsForHarvester.before - if (before) { - before(request, reply) - return; - } - } - reply.continue() - }) - server.ext('onPreResponse', (request, reply) => { function globallySetContentTypeJsonApi(request) { request.response = request.response || {} diff --git a/test/onbefore.spec.js b/test/onbefore.spec.js index 4c727f4..dcaef79 100644 --- a/test/onbefore.spec.js +++ b/test/onbefore.spec.js @@ -7,10 +7,10 @@ const schema = { brands: { type: 'brands', attributes: {}, - config: { - plugins: { - harvester: { - before(req, reply) { + config: { + ext: { + onPreHandler: { + method(req, reply) { let code = 404; if (req.method === 'get') { if (req.params.id) {