MCPcopy
hub / github.com/hapijs/hapi / onPreHandler

Function onPreHandler

test/request.js:683–696  ·  view source on GitHub ↗
(request, h)

Source from the content-addressed store, hash-verified

681
682 let firstRequest = true;
683 const onPreHandler = async (request, h) => {
684
685 if (firstRequest) {
686 client.destroy();
687 firstRequest = false;
688 }
689 else {
690 // To avoid timing differences between node versions, ensure that
691 // the second and third requests always experience the disconnect
692 await team.work;
693 }
694
695 return h.continue;
696 };
697
698 server.ext('onPreHandler', onPreHandler);
699

Callers

nothing calls this directly

Calls 1

destroyMethod · 0.80

Tested by

no test coverage detected