Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing a bug that it required whitespace after colon in the header. #126

  • Loading branch information...
commit b5f4ab7987d3239e40219953f7e395649dcebeb9 1 parent 10410eb
Hiroshi Ichikawa authored
BIN  WebSocketMain.swf
View
Binary file not shown
BIN  WebSocketMainInsecure.zip
View
Binary file not shown
8 flash-src/src/net/gimite/websocket/WebSocket.as
View
@@ -382,13 +382,15 @@ public class WebSocket extends EventDispatcher {
var lowerHeader:Object = {};
for (var i:int = 1; i < lines.length; ++i) {
if (lines[i].length == 0) continue;
- var m:Array = lines[i].match(/^(\S+): (.*)$/);
+ var m:Array = lines[i].match(/^(\S+):(.*)$/);
if (!m) {
onConnectionError("failed to parse response header line: " + lines[i]);
return false;
}
- header[m[1].toLowerCase()] = m[2];
- lowerHeader[m[1].toLowerCase()] = m[2].toLowerCase();
+ var key:String = m[1].toLowerCase();
+ var value:String = StringUtil.trim(m[2]);
+ header[key] = value;
+ lowerHeader[key] = value.toLowerCase();
}
if (lowerHeader["upgrade"] != "websocket") {
onConnectionError("invalid Upgrade: " + header["Upgrade"]);
Please sign in to comment.
Something went wrong with that request. Please try again.