You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ro...@apache.org on 2015/06/29 23:46:39 UTC

[33/50] couch commit: updated refs/heads/COUCHDB-2734-header-date to f3e022c

clean up conditionals


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/ef24a573
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/ef24a573
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/ef24a573

Branch: refs/heads/COUCHDB-2734-header-date
Commit: ef24a5733ea31b642d6ce7fa48c61ebd8a585311
Parents: 5501126
Author: Bob Ippolito <bo...@redivi.com>
Authored: Wed Dec 25 15:33:36 2013 -0800
Committer: Bob Ippolito <bo...@redivi.com>
Committed: Wed Dec 25 15:33:36 2013 -0800

----------------------------------------------------------------------
 src/mochiweb_websocket.erl | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/ef24a573/src/mochiweb_websocket.erl
----------------------------------------------------------------------
diff --git a/src/mochiweb_websocket.erl b/src/mochiweb_websocket.erl
index 5224312..3b87629 100644
--- a/src/mochiweb_websocket.erl
+++ b/src/mochiweb_websocket.erl
@@ -104,16 +104,14 @@ make_handshake(Req) ->
     Sec1Key = Req:get_header_value("Sec-WebSocket-Key1"),
     Sec2Key = Req:get_header_value("Sec-WebSocket-Key2"),
     Origin = Req:get_header_value(origin),
-    if not (SecKey == undefined) ->
-          hybi_handshake(SecKey);
-
-        (not (Sec1Key == undefined)) and (not (Sec2Key == undefined)) ->
+    if SecKey =/= undefined ->
+            hybi_handshake(SecKey);
+       Sec1Key =/= undefined andalso Sec2Key =/= undefined ->
             Host = Req:get_header_value("Host"),
             Path = Req:get(path),
             Body = Req:recv(8),
             Scheme = scheme(Req),
             hixie_handshake(Scheme, Host, Path, Sec1Key, Sec2Key, Body, Origin);
-
        true ->
           error
     end.