Skip to content

Commit

Permalink
Making sure that a few pieces of data on WebSocketRequest objects are…
Browse files Browse the repository at this point in the history
… cleaned up properly after they're no longer needed.
  • Loading branch information
theturtle32 committed Dec 27, 2012
1 parent 42e3a29 commit f25c961
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/WebSocketRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,14 @@ WebSocketRequest.prototype.accept = function(acceptedProtocol, allowedOrigin, co
// TODO: Handle extensions
if (acceptedProtocol) {
var protocolFullCase = this.protocolFullCaseMap[acceptedProtocol.toLocaleLowerCase()];
this.protocolFullCaseMap = null;
if (typeof(protocolFullCase) === 'undefined') {
protocolFullCase = acceptedProtocol;
}
}
else {
protocolFullCase = acceptedProtocol;
}
this.protocolFullCaseMap = null;

var connection = new WebSocketConnection(this.socket, [], acceptedProtocol, false, this.serverConfig);

Expand Down Expand Up @@ -290,9 +290,9 @@ WebSocketRequest.prototype.accept = function(acceptedProtocol, allowedOrigin, co

protocolFullCase = protocolFullCase.replace(headerSanitizeRegExp, '');
response += "Sec-WebSocket-Protocol: " + protocolFullCase + "\r\n";

this.requestedProtocols = null;
}
this.requestedProtocols = null;

if (allowedOrigin) {
allowedOrigin = allowedOrigin.replace(headerSanitizeRegExp, '');
if (this.webSocketVersion === 13) {
Expand Down

0 comments on commit f25c961

Please sign in to comment.