File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ class RPCServer extends EventEmitter {
86
86
const ac = new AbortController ( ) ;
87
87
const { signal} = ac ;
88
88
89
- const url = new URL ( request . url , 'http://localhost' ) ;
89
+ const url = new URL ( 'http://localhost' + ( request . url || '/' ) ) ;
90
90
const pathParts = url . pathname . split ( '/' ) ;
91
91
const identity = decodeURIComponent ( pathParts . pop ( ) ) ;
92
92
@@ -129,7 +129,7 @@ class RPCServer extends EventEmitter {
129
129
throw new WebsocketUpgradeError ( 400 , "Can only upgrade websocket upgrade requests" ) ;
130
130
}
131
131
132
- const endpoint = pathParts . join ( '/' ) ;
132
+ const endpoint = pathParts . join ( '/' ) || '/' ;
133
133
const remoteAddress = request . socket . remoteAddress ;
134
134
const protocols = ( 'sec-websocket-protocol' in request . headers )
135
135
? parseSubprotocols ( request . headers [ 'sec-websocket-protocol' ] )
You can’t perform that action at this time.
0 commit comments