const customSanitizer = (dirtyObj) => { // ... return cleanObj;}
// example{ path: '/', method: 'get', handler: (request, reply) => { ... }, options: { plugins: { disinfect: { disinfectQuery: true, disinfectParams: false, disinfectPayload: true } } }}
{ path: '/', method: 'get', handler: (request, reply) => { ... }, options: { plugins: { disinfect: false } }}
const registerPlugins = async (server) => Promise.all([ server.register({ plugin: require('disinfect'), options: { disinfectQuery: true, disinfectParams: true, disinfectPayload: true } })]); registerPlugins(server) .then(() => { // ... }) .catch((err) => { // ... })