Permalink
Browse files

fixed inconsistent websocket origin check

  • Loading branch information...
ostinelli committed Jan 22, 2012
1 parent 5143979 commit 33ab59591b071c275d75c80de2b8b731bd201b81
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/misultin_websocket.erl
@@ -58,7 +58,12 @@ check(WsVersions, _Path, Headers) ->
connect(ServerRef, SessionsRef, #req{headers = Headers} = Req, #ws{vsn = Vsn, socket = Socket, socket_mode = SocketMode, path = Path} = Ws, WsLoop) ->
?LOG_DEBUG("building handshake response", []),
% get data
- Origin = misultin_utility:header_get_value('Origin', Headers),
+ Origin = case misultin_utility:header_get_value('Origin', Headers) of
+ false ->
+ misultin_utility:header_get_value('Origin', Headers);

This comment has been minimized.

Show comment Hide comment
@RJ

RJ Jan 22, 2012

Contributor

This one should be Sec-Websocket-Origin ?

@RJ

RJ Jan 22, 2012

Contributor

This one should be Sec-Websocket-Origin ?

This comment has been minimized.

Show comment Hide comment
@ostinelli

ostinelli Jan 22, 2012

Owner

it sure should 59a72fd

@ostinelli

ostinelli Jan 22, 2012

Owner

it sure should 59a72fd

+ OriginHeader ->
+ OriginHeader
+ end,
Host = misultin_utility:header_get_value('Host', Headers),
% build handshake
VsnMod = get_module_name_from_vsn(Vsn),

0 comments on commit 33ab595

Please sign in to comment.