nodemcu-httpserver/httpserver-error.lua
Gregor 9b33c564db use httpserver-header.lua in httpserver-error.lua implementation
Add all HTTP response codes used in the project
allow extra headers to be passed
2017-05-29 20:55:42 +02:00

9 lines
470 B
Lua

-- httpserver-error.lua
-- Part of nodemcu-httpserver, handles sending error pages to client.
-- Author: Marcos Kirsch, Gregor Hartmann
return function (connection, req, args)
local statusString = dofile("httpserver-header.lc")(connection, req.code, "html", false, req.headers)
connection:send("<html><head><title>" .. req.code .. " - " .. statusString .. "</title></head><body><h1>" .. req.code .. " - " .. statusString .. "</h1></body></html>\r\n")
end