Comparison

mod_server_status/mod_server_status.lua @ 657:26e61a9afb5c

mod_server_status: for sure xml isn't json, passing json mime and viceversa isn't appropriate at all. *no no*
author Marco Cirillo <maranda@lightwitch.org>
date Sun, 29 Apr 2012 20:29:07 +0000
parent 656:74bd7ebe5792
child 658:39306c770d7d
comparison
equal deleted inserted replaced
656:74bd7ebe5792 657:26e61a9afb5c
110 -- http handlers 110 -- http handlers
111 111
112 local function request(event) 112 local function request(event)
113 local response = event.response 113 local response = event.response
114 if not json_output then 114 if not json_output then
115 response.headers.content_type = "application/json" 115 response.headers.content_type = "text/xml"
116 response:send(forge_response_xml()) 116 response:send(forge_response_xml())
117 else 117 else
118 response.headers.content_type = "text/xml" 118 response.headers.content_type = "application/json"
119 response:send(forge_response_json()) 119 response:send(forge_response_json())
120 end 120 end
121 end 121 end
122 122
123 -- initialization. 123 -- initialization.