]> git.proxmox.com Git - ceph.git/blame - ceph/src/civetweb/test/ajax/echo.lua
buildsys: switch source download to quincy
[ceph.git] / ceph / src / civetweb / test / ajax / echo.lua
CommitLineData
7c673cae
FG
1resp = "{";\r
2\r
3method = mg.request_info.request_method\r
4uri = mg.request_info.uri\r
5query = mg.request_info.query_string\r
6datalen = nil -- TODO: "CONTENT_LENGTH" !\r
7\r
8if method then\r
9 resp = resp .. '"method" : "' .. method .. '", ';\r
10end\r
11if uri then\r
12 resp = resp .. '"uri" : "' .. uri .. '", ';\r
13end\r
14if query then\r
15 resp = resp .. '"query" : "' .. query .. '", ';\r
16end\r
17if datalen then\r
18 resp = resp .. '"datalen" : "' .. datalen .. '", ';\r
19end\r
20\r
21resp = resp .. '"time" : "' .. os.date() .. '" ';\r
22\r
23resp = resp .. "}";\r
24\r
25\r
26\r
27mg.write("HTTP/1.1 200 OK\r\n")\r
28mg.write("Connection: close\r\n")\r
29mg.write("Content-Type: text/html\r\n")\r
30mg.write("Cache-Control: no-cache\r\n")\r
31--mg.write("Content-Length: " .. resp:len() .. "\n")\r
32mg.write("\r\n")\r
33\r
34mg.write(resp)\r
35\r