diff options
author | Kim Alvefur <zash@zash.se> | 2012-12-11 22:30:50 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2012-12-11 22:30:50 +0100 |
commit | 3860775600e5a3b6706c8c96e50d8500d578e687 (patch) | |
tree | 3e7b37f096ebc738f361d82f43182b37122979cb /plugins/mod_http_files.lua | |
parent | 48bb0d814ebfdbdfc49017592444e7fad0358ed6 (diff) | |
download | prosody-3860775600e5a3b6706c8c96e50d8500d578e687.tar.gz prosody-3860775600e5a3b6706c8c96e50d8500d578e687.zip |
mod_http_files: Add Last-Modified header
Diffstat (limited to 'plugins/mod_http_files.lua')
-rw-r--r-- | plugins/mod_http_files.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/plugins/mod_http_files.lua b/plugins/mod_http_files.lua index 0add5c86..7e181ed4 100644 --- a/plugins/mod_http_files.lua +++ b/plugins/mod_http_files.lua @@ -9,6 +9,7 @@ module:depends("http"); local lfs = require "lfs"; +local os_date = os.date; local open = io.open; local stat = lfs.attributes; @@ -35,6 +36,7 @@ function serve_file(event, path) return 404; end + response.headers.last_modified = os_date('!%a, %d %b %Y %H:%M:%S GMT', attr.modification); local tag = ("%02x-%x-%x-%x"):format(attr.dev or 0, attr.ino or 0, attr.size or 0, attr.modification or 0); response.headers.etag = tag; |