Commit 3fdfef3068c253446b337e1e557442dc3de73b90

Authored by zhouhaihai
1 parent 86a873b9

httpweb

Showing 2 changed files with 5 additions and 3 deletions   Show diff stats
src/actions/HttpAction.lua
... ... @@ -151,7 +151,7 @@ function _M.query_role(query)
151 151 if not query.uid then return "not found" end
152 152 local user = redisproxy:get(string.format("uid:%s", query.uid))
153 153 if not user then return "not found" end
154   - local roleId = redisproxy:get(string_format("user:%s", string.upper(user)))
  154 + local roleId = redisproxy:get(string.format("user:%s", string.upper(user)))
155 155 if not roleId then return "not found" end
156 156 return json.encode({roleId, user})
157 157 end
... ...
src/services/httpweb.lua
... ... @@ -41,8 +41,10 @@ local port = ...
41 41 port = tonumber(port)
42 42  
43 43 local key = "zhaolu1234dangge"
44   -local function response(id, ...)
45   - local ok, err = httpd.write_response(sockethelper.writefunc(id), ...)
  44 +local function response(id, code, body)
  45 + local ok, err = httpd.write_response(sockethelper.writefunc(id), code, body, {
  46 + ["Connection"] = "Close",
  47 + })
46 48 if not ok then
47 49 -- if err == sockethelper.socket_error , that means socket closed.
48 50 skynet.error(string.format("fd = %d, %s", id, err))
... ...