mirror of
https://github.com/openwrt/packages.git
synced 2025-12-22 12:34:35 +04:00
prometheus-node-exporter-lua: respond with HTTP/1.0
also reduce calls to output() Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
This commit is contained in:
@@ -327,18 +327,11 @@ end
|
|||||||
-- Web server-specific functions
|
-- Web server-specific functions
|
||||||
|
|
||||||
function http_ok_header()
|
function http_ok_header()
|
||||||
output("HTTP/1.1 200 OK\r")
|
output("HTTP/1.0 200 OK\r\nServer: lua-metrics\r\nContent-Type: text/plain; version=0.0.4\r\n\r")
|
||||||
output("Server: lua-metrics\r")
|
|
||||||
output("Content-Type: text/plain; version=0.0.4\r")
|
|
||||||
output("\r")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function http_not_found()
|
function http_not_found()
|
||||||
output("HTTP/1.1 404 Not Found\r")
|
output("HTTP/1.0 404 Not Found\r\nServer: lua-metrics\r\nContent-Type: text/plain\r\n\r\nERROR: File Not Found.")
|
||||||
output("Server: lua-metrics\r")
|
|
||||||
output("Content-Type: text/plain\r")
|
|
||||||
output("\r")
|
|
||||||
output("ERROR: File Not Found.")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function serve(request)
|
function serve(request)
|
||||||
|
|||||||
Reference in New Issue
Block a user