@@ -338,7 +338,7 @@ const register = async (server, pluginOptions) => {
338
338
} )
339
339
}
340
340
} )
341
- } } )
341
+ } } )
342
342
343
343
/* perform WebSocket handling on HAPI stop */
344
344
server . ext ( { type : "onPreStop" , method : ( server , h ) => {
@@ -359,7 +359,7 @@ const register = async (server, pluginOptions) => {
359
359
else
360
360
resolve ( )
361
361
} )
362
- } } )
362
+ } } )
363
363
364
364
/* make available to HAPI request the remote WebSocket information */
365
365
server . ext ( { type : "onRequest" , method : ( request , h ) => {
@@ -368,7 +368,7 @@ const register = async (server, pluginOptions) => {
368
368
request . info . remotePort = request . plugins . websocket . req . socket . remotePort
369
369
}
370
370
return h . continue
371
- } } )
371
+ } } )
372
372
373
373
/* allow WebSocket information to be easily retrieved */
374
374
server . decorate ( "request" , "websocket" , ( request ) => {
@@ -389,7 +389,7 @@ const register = async (server, pluginOptions) => {
389
389
return Boom . badRequest ( "Plain HTTP request to a WebSocket-only route not allowed" )
390
390
}
391
391
return h . continue
392
- } } )
392
+ } } )
393
393
394
394
/* handle request/response hooks */
395
395
server . ext ( { type : "onPostAuth" , method : ( request , h ) => {
@@ -399,15 +399,15 @@ const register = async (server, pluginOptions) => {
399
399
request . plugins . websocket , request , h )
400
400
}
401
401
return h . continue
402
- } } )
402
+ } } )
403
403
server . ext ( { type : "onPostHandler" , method : ( request , h ) => {
404
404
if ( isRouteWebSocketEnabled ( request . route ) && isRequestWebSocketDriven ( request ) ) {
405
405
let routeOptions = fetchRouteOptions ( request . route )
406
406
return routeOptions . response . call ( request . plugins . websocket . ctx ,
407
407
request . plugins . websocket , request , h )
408
408
}
409
409
return h . continue
410
- } } )
410
+ } } )
411
411
}
412
412
413
413
/* export register function, wrapped in a plugin object */
0 commit comments