feat: 优化插件加载逻辑
This commit is contained in:
@@ -147,7 +147,7 @@ export class NettyWebSocket extends Transport {
|
||||
}))
|
||||
}
|
||||
abortHandshake(reason: Error): void {
|
||||
this.handler.abortHandshake(reason)
|
||||
if (this.handler) this.handler.abortHandshake(reason)
|
||||
}
|
||||
getChannel() {
|
||||
return this.channel
|
||||
|
||||
@@ -56,7 +56,8 @@ export abstract class Transport extends EventEmitter {
|
||||
this.abortHandshake(new Error(msg));
|
||||
return;
|
||||
}
|
||||
if (code != 1000 && (code < 3000 || code > 4999)) {
|
||||
// if socket is clean ignore code check
|
||||
if (code != 1000 && (code < 3000 || code > 4999) && !wasClean) {
|
||||
throw new Error(`The code must be either 1000, or between 3000 and 4999. ${code} is neither.`)
|
||||
}
|
||||
this.readyState = WebSocket.CLOSING
|
||||
|
||||
Reference in New Issue
Block a user