Skip to content

Commit

Permalink
refactor: simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne committed Nov 9, 2023
1 parent 3b5e79e commit 43c1c1c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
11 changes: 0 additions & 11 deletions lib/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,12 +464,6 @@ export abstract class BaseServer extends EventEmitter {
} else if ("websocket" === transportName) {
transport.perMessageDeflate = this.opts.perMessageDeflate;
}

if (req._query && req._query.b64) {
transport.supportsBinary = false;
} else {
transport.supportsBinary = true;
}
} catch (e) {
debug('error handshaking to transport "%s"', transportName);
this.emit("connection_error", {
Expand Down Expand Up @@ -862,11 +856,6 @@ export class Server extends BaseServer {
websocket.removeListener("error", onUpgradeError);

const transport = this.createTransport(req._query.transport, req);
if (req._query && req._query.b64) {
transport.supportsBinary = false;
} else {
transport.supportsBinary = true;
}
transport.perMessageDeflate = this.opts.perMessageDeflate;
client.maybeUpgrade(transport);
}
Expand Down
1 change: 1 addition & 0 deletions lib/transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export abstract class Transport extends EventEmitter {
this.discarded = false;
this.protocol = req._query.EIO === "4" ? 4 : 3; // 3rd revision by default
this.parser = this.protocol === 4 ? parser_v4 : parser_v3;
this.supportsBinary = !(req._query && req._query.b64);
}

/**
Expand Down

0 comments on commit 43c1c1c

Please sign in to comment.