Skip to content

Commit

Permalink
Throw when registration options are passed
Browse files Browse the repository at this point in the history
  • Loading branch information
kanongil committed Oct 27, 2017
1 parent aa3fe79 commit ceadca7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/index.js
Expand Up @@ -22,8 +22,9 @@ exports.plugin = {
pkg: require('../package.json'),
once: true,

register(server) {
register(server, options) {

Hoek.assert(Object.keys(options).length === 0, 'Inert does not support registration options');
const settings = Joi.attempt(Hoek.reach(server.settings.plugins, 'inert') || {}, internals.schema, 'Invalid "inert" server options');

server.expose('_etags', settings.etagsCacheMaxSize > 0 ? new Etag.Cache(settings.etagsCacheMaxSize) : null);
Expand Down

0 comments on commit ceadca7

Please sign in to comment.