]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/jaegertracing/opentelemetry-cpp/third_party/prometheus-cpp/3rdparty/civetweb/test/ajax/echo.cgi.old
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / third_party / prometheus-cpp / 3rdparty / civetweb / test / ajax / echo.cgi.old
diff --git a/ceph/src/jaegertracing/opentelemetry-cpp/third_party/prometheus-cpp/3rdparty/civetweb/test/ajax/echo.cgi.old b/ceph/src/jaegertracing/opentelemetry-cpp/third_party/prometheus-cpp/3rdparty/civetweb/test/ajax/echo.cgi.old
new file mode 100644 (file)
index 0000000..3f4eeeb
--- /dev/null
@@ -0,0 +1,73 @@
+#!/usr/bin/lua5.1\r
+\r
+-- Every CGI script that returns any valid JSON object will work in the test.\r
+-- In case you do not have not yet used CGI, you may want to use this script which is written in Lua.\r
+-- You may download an interpreter from http://luabinaries.sourceforge.net/download.html, extract it\r
+-- to some folder in your search path (the path of the webserver or /usr/bin on Linux), and add the\r
+-- following lines to your .conf file.\r
+-- cgi_interpreter c:\somewhere\lua5.1.exe\r
+-- enable_keep_alive yes\r
+\r
+resp = "{";\r
+\r
+method = os.getenv("REQUEST_METHOD")\r
+uri = os.getenv("REQUEST_URI");\r
+query = os.getenv("QUERY_STRING");\r
+datalen = os.getenv("CONTENT_LENGTH");\r
+\r
+if method then\r
+  resp = resp .. '"method" : "' .. method .. '", ';\r
+end\r
+if uri then\r
+  resp = resp .. '"uri" : "' .. uri .. '", ';\r
+end\r
+if query then\r
+  resp = resp .. '"query" : "' .. query .. '", ';\r
+end\r
+if datalen then\r
+  resp = resp .. '"datalen" : "' .. datalen .. '", ';\r
+end\r
+\r
+resp = resp .. '"time" : "' .. os.date() .. '" ';\r
+\r
+resp = resp .. "}";\r
+\r
+\r
+\r
+\r
+print "Status: 200 OK"\r
+print "Connection: close"\r
+--print "Connection: keep-alive"\r
+print "Content-Type: text/html; charset=utf-8"\r
+print "Cache-Control: no-cache"\r
+--print ("Content-Length: " .. resp:len())\r
+print ""\r
+\r
+print (resp)\r
+\r
+\r
+doLogging = false\r
+\r
+if (doLogging) then\r
+  -- Store the POST data to a file\r
+  if (method == "POST") then\r
+    myFile = io.open("data" .. query:sub(4) .. ".txt", "wb");\r
+    myFile:write(resp)\r
+    myFile:write("\r\n\r\n")  \r
+    if datalen then\r
+      datalen = tonumber(datalen)\r
+      myFile:write("<<< " .. datalen .. " bytes of data >>>\r\n")\r
+      \r
+      data = io.stdin:read(datalen)\r
+      myFile:write(data)\r
+      \r
+      myFile:write("\r\n<<< end >>>\r\n")\r
+    else\r
+      myFile:write("<<< no data >>>\r\n")\r
+    end  \r
+    myFile:close()\r
+  end\r
+end\r
+\r
+\r
+\r