Comparison

plugins/mod_http_files.lua @ 8757:861a7d6c12d8

mod_http_files: Correct cache insertion (fixes #1130)
author Kim Alvefur <zash@zash.se>
date Tue, 17 Apr 2018 18:40:57 +0200
parent 7991:35a02ba83af2
child 9462:6489d75ff1d6
comparison
equal deleted inserted replaced
8741:0fd63ed1f647 8757:861a7d6c12d8
142 data = server._events.fire_event("directory-index", { path = request.path, full_path = full_path }); 142 data = server._events.fire_event("directory-index", { path = request.path, full_path = full_path });
143 end 143 end
144 if not data then 144 if not data then
145 return 403; 145 return 403;
146 end 146 end
147 cache[orig_path] = { data = data, content_type = mime_map.html; etag = etag; }; 147 cache:set(orig_path, { data = data, content_type = mime_map.html; etag = etag; });
148 response_headers.content_type = mime_map.html; 148 response_headers.content_type = mime_map.html;
149 149
150 else 150 else
151 local f, err = open(full_path, "rb"); 151 local f, err = open(full_path, "rb");
152 if not f then 152 if not f then