nodemcu-httpserver/httpserver-error.lua
Gregor addda8dbe7 use correct code for erropage instead of failing
Sorry I didn't see this earlier
2017-05-31 22:27:29 +02:00

10 lines
495 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)
req.code = args.code
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