net/http/files.lua
changeset 10069 b399dca1273c
parent 10065 5c71693c8345
child 10331 34f7a0e8fa59
equal deleted inserted replaced
10068:1acfd25cd507 10069:b399dca1273c
    92 
    92 
    93 		local data = cache:get(orig_path);
    93 		local data = cache:get(orig_path);
    94 		if data and data.etag == etag then
    94 		if data and data.etag == etag then
    95 			response_headers.content_type = data.content_type;
    95 			response_headers.content_type = data.content_type;
    96 			data = data.data;
    96 			data = data.data;
    97 			cache:get(orig_path, data);
    97 			cache:set(orig_path, data);
    98 		elseif attr.mode == "directory" and path then
    98 		elseif attr.mode == "directory" and path then
    99 			if full_path:sub(-1) ~= "/" then
    99 			if full_path:sub(-1) ~= "/" then
   100 				local dir_path = { is_absolute = true, is_directory = true };
   100 				local dir_path = { is_absolute = true, is_directory = true };
   101 				for dir in orig_path:gmatch("[^/]+") do dir_path[#dir_path+1]=dir; end
   101 				for dir in orig_path:gmatch("[^/]+") do dir_path[#dir_path+1]=dir; end
   102 				response_headers.location = build_path(dir_path);
   102 				response_headers.location = build_path(dir_path);