Skip to content

Commit

Permalink
fix cluster example: parse host port
Browse files Browse the repository at this point in the history
  • Loading branch information
sniper00 committed Oct 13, 2023
1 parent b2d6f78 commit c2c3e0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion example/cluster_etc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ httpserver.on("/cluster",function(request, response)
response.status_code = 200
response:write_header("Content-Type","application/json")

local host, port = socket.parse_host_port(cfg.cluster)
local host, port = cfg.cluster:match("([^:]+):?(%d*)$") port = math.tointeger(port) or 80
response:write(json.encode({host = host, port = port}))
end)

Expand Down

0 comments on commit c2c3e0c

Please sign in to comment.