1 module("luci.httpd.handler.luci", package.seeall)
2 require("luci.dispatcher")
6 Luci = luci.util.class(luci.httpd.module.Handler)
7 Response = luci.httpd.module.Response
9 function Luci.__init__(self)
10 luci.httpd.module.Handler.__init__(self)
13 function Luci.handle_head(self, ...)
14 local response, sourceout = self:handle_get(...)
18 function Luci.handle_post(self, ...)
19 return self:handle_get(...)
22 function Luci.handle_get(self, request, sourcein, sinkerr)
23 local r = luci.http.Request(
29 local res, id, data1, data2 = true, 0, nil, nil
33 local x = coroutine.create(luci.dispatcher.httpdispatch)
34 while not id or id < 3 do
37 res, id, data1, data2 = coroutine.resume(x, r)
41 headers["Content-Type"] = "text/plain"
43 return status, headers, function() local x = table.remove(err) return x end
49 headers[data1] = data2
54 local res, id, data = coroutine.resume(x)
66 return Response(status, headers), iter