Skip to content

Commit

Permalink
Converted all indents to spaces in headers.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantin Burkalev authored and Konstantin Burkalev committed Mar 1, 2015
1 parent 36a2f1b commit cf69816
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/wiola/headers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ local wsProto = ngx.req.get_headers()["Sec-WebSocket-Protocol"]
ngx.log(ngx.DEBUG, "Client Sec-WebSocket-Protocol: ", wsProto)

if wsProto then
local wsProtos = {}
local i = 1
local wsProtos = {}
local i = 1

for p in string.gmatch(wsProto, '([^, ]+)') do
wsProtos[#wsProtos+1] = p
end
for p in string.gmatch(wsProto, '([^, ]+)') do
wsProtos[#wsProtos+1] = p
end

while i <= #wsProtos do
if wsProtos[i] == 'wamp.2.json' or wsProtos[i] == 'wamp.2.msgpack' then
ngx.header["Sec-WebSocket-Protocol"] = wsProtos[i]
ngx.log(ngx.DEBUG, "Server Sec-WebSocket-Protocol selected: ", wsProtos[i])
break
end
i = i + 1
end
while i <= #wsProtos do
if wsProtos[i] == 'wamp.2.json' or wsProtos[i] == 'wamp.2.msgpack' then
ngx.header["Sec-WebSocket-Protocol"] = wsProtos[i]
ngx.log(ngx.DEBUG, "Server Sec-WebSocket-Protocol selected: ", wsProtos[i])
break
end
i = i + 1
end
end

0 comments on commit cf69816

Please sign in to comment.