* libs/httpd: Added Cache-Control header to LuCI
authorSteven Barth <steven@midlink.org>
Sat, 28 Jun 2008 16:23:58 +0000 (16:23 +0000)
committerSteven Barth <steven@midlink.org>
Sat, 28 Jun 2008 16:23:58 +0000 (16:23 +0000)
* libs/httpd: Added Server-Header

libs/httpd/luasrc/httpd/handler/luci.lua
libs/httpd/luasrc/httpd/server.lua

index 4a83de1..17882e2 100644 (file)
@@ -66,7 +66,12 @@ function Luci.handle_get(self, request, sourcein, sinkerr)
                        headers[data1] = data2
                end
        end
                        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
        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["Expires"] = luci.http.protocol.date.to_http( os.time() )
        headers["Date"]    = headers["Expires"]
+       headers["Cache-Control"] = "no-cache"
 
        return Response(status, headers), iter
 end
 
        return Response(status, headers), iter
 end
index e5b8620..7bfac68 100644 (file)
@@ -20,6 +20,7 @@ require("socket.http")
 require("luci.util")
 
 READ_BUFSIZE = 1024
 require("luci.util")
 
 READ_BUFSIZE = 1024
+VERSION = 0.2
 
 
 VHost = luci.util.class()
 
 
 VHost = luci.util.class()
@@ -212,6 +213,8 @@ function Server.process( self, client )
                        tostring(response.status) .. " " ..
                        luci.http.protocol.statusmsg[response.status] .. "\r\n"
 
                        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"
                
                for k,v in pairs(response.headers) do
                        header = header .. k .. ": " .. v .. "\r\n"