(request, h)
| 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 |