Mercurial > prosody-hg
comparison plugins/mod_http_files.lua @ 5247:9257f4c47ffa
mod_http_files: Fix caching the stringified directory index
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 16 Dec 2012 08:17:28 +0100 |
| parents | 0cc0359d8c39 |
| children | 13553f4132a8 |
comparison
equal
deleted
inserted
replaced
| 5245:f29741c96090 | 5247:9257f4c47ffa |
|---|---|
| 96 :tag("a", { href = file }):text(file) | 96 :tag("a", { href = file }):text(file) |
| 97 :up():up(); | 97 :up():up(); |
| 98 end | 98 end |
| 99 end | 99 end |
| 100 data = "<!DOCTYPE html>\n"..tostring(html); | 100 data = "<!DOCTYPE html>\n"..tostring(html); |
| 101 cache[path] = { data = html, content_type = mime_map.html; hits = 0 }; | 101 cache[path] = { data = data, content_type = mime_map.html; hits = 0 }; |
| 102 response.headers.content_type = mime_map.html; | 102 response.headers.content_type = mime_map.html; |
| 103 end | 103 end |
| 104 | 104 |
| 105 else | 105 else |
| 106 local f = open(full_path, "rb"); | 106 local f = open(full_path, "rb"); |
