Software /
code /
prosody
Comparison
plugins/mod_http_files.lua @ 9463:f7530c846f98
mod_http_files: Rename variable to avoid name clash [luacheck]
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 10 Oct 2018 21:54:12 +0200 |
parent | 9462:6489d75ff1d6 |
child | 9950:afc48785f738 |
child | 10776:8f3b87eaec49 |
comparison
equal
deleted
inserted
replaced
9462:6489d75ff1d6 | 9463:f7530c846f98 |
---|---|
126 if data and data.etag == etag then | 126 if data and data.etag == etag then |
127 response_headers.content_type = data.content_type; | 127 response_headers.content_type = data.content_type; |
128 data = data.data; | 128 data = data.data; |
129 elseif attr.mode == "directory" and path then | 129 elseif attr.mode == "directory" and path then |
130 if full_path:sub(-1) ~= "/" then | 130 if full_path:sub(-1) ~= "/" then |
131 local path = { is_absolute = true, is_directory = true }; | 131 local dir_path = { is_absolute = true, is_directory = true }; |
132 for dir in orig_path:gmatch("[^/]+") do path[#path+1]=dir; end | 132 for dir in orig_path:gmatch("[^/]+") do dir_path[#dir_path+1]=dir; end |
133 response_headers.location = build_path(path); | 133 response_headers.location = build_path(dir_path); |
134 return 301; | 134 return 301; |
135 end | 135 end |
136 for i=1,#dir_indices do | 136 for i=1,#dir_indices do |
137 if stat(full_path..dir_indices[i], "mode") == "file" then | 137 if stat(full_path..dir_indices[i], "mode") == "file" then |
138 return serve_file(event, path..dir_indices[i]); | 138 return serve_file(event, path..dir_indices[i]); |