From fc8bd680229c58e813b95db025eb7ab55f862d87 Mon Sep 17 00:00:00 2001 From: Drew Ditthardt Date: Sat, 3 Dec 2011 22:13:23 -0800 Subject: [PATCH] Fixed connecting from websocket on local --- Handlers/WebSocket/hybi10/Handshakes.cs | 4 +--- Handlers/WebSocket/hybi10/WebSocketAuthentication.cs | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Handlers/WebSocket/hybi10/Handshakes.cs b/Handlers/WebSocket/hybi10/Handshakes.cs index 4811352..4bc5ef1 100644 --- a/Handlers/WebSocket/hybi10/Handshakes.cs +++ b/Handlers/WebSocket/hybi10/Handshakes.cs @@ -83,9 +83,7 @@ public bool IsValid() return ( (Host != null) && (Key != null) && - (Int32.Parse(Version) >= 8) && - (Origin != null) && - (ResourcePath != null) + (Int32.Parse(Version) >= 8) ); } diff --git a/Handlers/WebSocket/hybi10/WebSocketAuthentication.cs b/Handlers/WebSocket/hybi10/WebSocketAuthentication.cs index 51ca4d3..7a795ce 100644 --- a/Handlers/WebSocket/hybi10/WebSocketAuthentication.cs +++ b/Handlers/WebSocket/hybi10/WebSocketAuthentication.cs @@ -75,10 +75,10 @@ public bool CheckHandshake(Context context) if (handshake.IsValid()) { // Optionally check Origin and Location if they're set. - if (Origin != string.Empty) + if (!String.IsNullOrEmpty(Origin)) if (handshake.Origin != "http://" + Origin) return false; - if (Location != string.Empty) + if (!String.IsNullOrEmpty(Location)) if (handshake.Host != Location + ":" + context.Server.Port.ToString()) return false; // Generate response handshake for the client