diff options
author | Steven Barth <steven@midlink.org> | 2008-06-28 16:23:58 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-06-28 16:23:58 +0000 |
commit | 699784791cfc05cc03ebce731dca5e5c29b0ab87 (patch) | |
tree | 9e9da27f736622fa366661b5b4e4396cf32f072e /libs | |
parent | cd4353e65fc5523d541e518577616245e00bd98f (diff) |
* libs/httpd: Added Cache-Control header to LuCI
* libs/httpd: Added Server-Header
Diffstat (limited to 'libs')
-rw-r--r-- | libs/httpd/luasrc/httpd/handler/luci.lua | 6 | ||||
-rw-r--r-- | libs/httpd/luasrc/httpd/server.lua | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/libs/httpd/luasrc/httpd/handler/luci.lua b/libs/httpd/luasrc/httpd/handler/luci.lua index 4a83de1a4..17882e258 100644 --- a/libs/httpd/luasrc/httpd/handler/luci.lua +++ b/libs/httpd/luasrc/httpd/handler/luci.lua @@ -66,7 +66,12 @@ function Luci.handle_get(self, request, sourcein, sinkerr) headers[data1] = data2 end end +<<<<<<< HEAD:libs/httpd/luasrc/httpd/handler/luci.lua +======= + + +>>>>>>> * libs/httpd: Added Cache-Control header to LuCI:libs/httpd/luasrc/httpd/handler/luci.lua local function iter() local res, id, data = coroutine.resume(x) if not res then @@ -82,6 +87,7 @@ function Luci.handle_get(self, request, sourcein, sinkerr) headers["Expires"] = luci.http.protocol.date.to_http( os.time() ) headers["Date"] = headers["Expires"] + headers["Cache-Control"] = "no-cache" return Response(status, headers), iter end diff --git a/libs/httpd/luasrc/httpd/server.lua b/libs/httpd/luasrc/httpd/server.lua index e5b862032..7bfac6862 100644 --- a/libs/httpd/luasrc/httpd/server.lua +++ b/libs/httpd/luasrc/httpd/server.lua @@ -20,6 +20,7 @@ require("socket.http") require("luci.util") READ_BUFSIZE = 1024 +VERSION = 0.2 VHost = luci.util.class() @@ -212,6 +213,8 @@ function Server.process( self, client ) tostring(response.status) .. " " .. luci.http.protocol.statusmsg[response.status] .. "\r\n" + header = header .. "Server: LuCI HTTPd/" .. tostring(VERSION) .. "\r\n" + for k,v in pairs(response.headers) do header = header .. k .. ": " .. v .. "\r\n" |