Mercurial > prosody-modules
comparison mod_xml_status/mod_xml_status.lua @ 527:caf28c2c56a1
mod_xml_status: re-removed http response function wrong code (self note: make sure what you're copy&pasting from the local notepad is fully correct)
| author | Marco Cirillo <maranda@lightwitch.org> |
|---|---|
| date | Sat, 07 Jan 2012 00:37:35 +0000 |
| parents | 0529658efd1e |
| children | 967ba17b1d2a |
comparison
equal
deleted
inserted
replaced
| 526:0529658efd1e | 527:caf28c2c56a1 |
|---|---|
| 99 if h then response.headers = h; end | 99 if h then response.headers = h; end |
| 100 return response | 100 return response |
| 101 end | 101 end |
| 102 | 102 |
| 103 local function request(method, body, request) | 103 local function request(method, body, request) |
| 104 if not prosody.stanza_counter then | |
| 105 local err500 = r_err:format("500", "Internal server error") | |
| 106 return response(500, err500) end | |
| 107 if method == "GET" then | 104 if method == "GET" then |
| 108 return response(200, forge_response()) | 105 return response(200, forge_response()) |
| 109 else | 106 else |
| 110 local err405 = r_err:format("405", "Only GET is supported") | 107 local err405 = r_err:format("405", "Only GET is supported") |
| 111 return response(405, err405, {["Allow"] = "GET"}) | 108 return response(405, err405, {["Allow"] = "GET"}) |
