Send Cache-Control headers by default
[project/luci.git] / libs / web / luasrc / http.lua
index dbfcad777282f5eb5c19f09ca46792696be4ab38..2540d08a312a187c62a0c7ef088f3d6689befab5 100644 (file)
@@ -51,8 +51,8 @@ function Request.__init__(self, env, sourcein, sinkerr)
        self.parsed_input = false
 end
 
-function Request.formvalue(self, name)
-       if not self.parsed_input then
+function Request.formvalue(self, name, noparse)
+       if not noparse and not self.parsed_input then
                self:_parse_input()
        end
        
@@ -187,6 +187,10 @@ function write(content, src_err)
                        if not context.headers or not context.headers["content-type"] then
                                header("Content-Type", "text/html; charset=utf-8")
                        end
+                       if not context.headers["cache-control"] then
+                               header("Cache-Control", "no-cache")
+                       end
+                       
                        
                        context.eoh = true
                        coroutine.yield(3)