Software /
code /
prosody-modules
Comparison
mod_xml_status/mod_xml_status.lua @ 525:a9cd75cc9563
mod_xml_status: small cleanup.
author | Marco Cirillo <maranda@lightwitch.org> |
---|---|
date | Fri, 06 Jan 2012 23:43:52 +0000 |
parent | 524:ff3ea8735d61 |
child | 526:0529658efd1e |
comparison
equal
deleted
inserted
replaced
524:ff3ea8735d61 | 525:a9cd75cc9563 |
---|---|
99 | 99 |
100 if h then response.headers = h; end | 100 if h then response.headers = h; end |
101 return response | 101 return response |
102 end | 102 end |
103 | 103 |
104 local function request(method, body, request) | 104 local function request(method, body, request) |
105 if not prosody.stanza_counter then | |
106 local err500 = r_err:format("500", "Internal server error") | |
107 return response(500, err500) end | |
108 if method == "GET" then | 105 if method == "GET" then |
109 return response(200, forge_response()) | 106 return response(200, forge_response()) |
110 else | 107 else |
111 local err405 = r_err:format("405", "Only GET is supported") | 108 local err405 = r_err:format("405", "Only GET is supported") |
112 return response(405, err405, {["Allow"] = "GET"}) | 109 return response(405, err405, {["Allow"] = "GET"}) |