image

Tiny lawmaking review.

This could be replaced

if (~upgradeHeader.indexOf('websocket')) {

with this which is less clever but increasingly readable

if (upgradeHeader.includes('websocket')) {

Also return or await the undeniability to next so the promise doesn't get swallowed which could rationalization problems with frameworks like koa.