Comparison

plugins/mod_http_files.lua @ 5269:7bc52402966d

mod_http_files: Fix sending Content-Type for index files
author Kim Alvefur <zash@zash.se>
date Sun, 23 Dec 2012 17:04:44 +0100
parent 5268:69964d1cbe66
child 5688:345761f0c2be
child 5716:8a0465de172e
comparison
equal deleted inserted replaced
5268:69964d1cbe66 5269:7bc52402966d
115 end 115 end
116 if not data then 116 if not data then
117 module:log("debug", "Could not open or read %s. Error was %s", full_path, err); 117 module:log("debug", "Could not open or read %s. Error was %s", full_path, err);
118 return 403; 118 return 403;
119 end 119 end
120 local ext = orig_path:match("%.([^./]+)$"); 120 local ext = full_path:match("%.([^./]+)$");
121 local content_type = ext and mime_map[ext]; 121 local content_type = ext and mime_map[ext];
122 cache[orig_path] = { data = data; content_type = content_type; etag = etag }; 122 cache[orig_path] = { data = data; content_type = content_type; etag = etag };
123 response_headers.content_type = content_type; 123 response_headers.content_type = content_type;
124 end 124 end
125 125