* luci/httpd: fix 500 error case in luci handler, added copyright stuff
This commit is contained in:
parent
231cd0b89d
commit
b8faf24d5c
2 changed files with 19 additions and 2 deletions
|
@ -1,4 +1,20 @@
|
||||||
|
--[[
|
||||||
|
|
||||||
|
HTTP server implementation for LuCI - luci handler
|
||||||
|
(c) 2008 Steven Barth <steven@midlink.org>
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
$Id$
|
||||||
|
|
||||||
|
]]--
|
||||||
|
|
||||||
module("luci.httpd.handler.luci", package.seeall)
|
module("luci.httpd.handler.luci", package.seeall)
|
||||||
|
|
||||||
require("luci.dispatcher")
|
require("luci.dispatcher")
|
||||||
require("luci.http")
|
require("luci.http")
|
||||||
require("ltn12")
|
require("ltn12")
|
||||||
|
@ -40,7 +56,7 @@ function Luci.handle_get(self, request, sourcein, sinkerr)
|
||||||
status = 500
|
status = 500
|
||||||
headers["Content-Type"] = "text/plain"
|
headers["Content-Type"] = "text/plain"
|
||||||
local err = {id}
|
local err = {id}
|
||||||
return status, headers, function() local x = table.remove(err) return x end
|
return Response( status, headers ), function() return table.remove(err) end
|
||||||
end
|
end
|
||||||
|
|
||||||
if id == 1 then
|
if id == 1 then
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
HTTP server implementation for LuCI - helper class
|
HTTP server implementation for LuCI - helper class
|
||||||
(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
|
(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
|
||||||
|
(c) 2008 Steven Barth <steven@midlink.org>
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|
Loading…
Reference in a new issue