Skip to content

Commit

Permalink
Fixed connecting from websocket on local
Browse files Browse the repository at this point in the history
  • Loading branch information
DorianGray committed Dec 4, 2011
1 parent 9609880 commit fc8bd68
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions Handlers/WebSocket/hybi10/Handshakes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ public bool IsValid()
return (
(Host != null) &&
(Key != null) &&
(Int32.Parse(Version) >= 8) &&
(Origin != null) &&
(ResourcePath != null)
(Int32.Parse(Version) >= 8)
);
}

Expand Down
4 changes: 2 additions & 2 deletions Handlers/WebSocket/hybi10/WebSocketAuthentication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fc8bd68

Please sign in to comment.