Comparison

plugins/mod_http_file_share.lua @ 11865:77bbbd4263d7

mod_http_file_share: Silence luacheck warning
author Kim Alvefur <zash@zash.se>
date Sat, 23 Oct 2021 13:32:01 +0200
parent 11864:fceebfb28d86
child 11873:2b85e4e7d389
comparison
equal deleted inserted replaced
11864:fceebfb28d86 11865:77bbbd4263d7
287 local fh, err = io.open(filename.."~", "w"); 287 local fh, err = io.open(filename.."~", "w");
288 if not fh then 288 if not fh then
289 module:log("error", "Could not open file for writing: %s", err); 289 module:log("error", "Could not open file for writing: %s", err);
290 return 500; 290 return 500;
291 end 291 end
292 function event.response:on_destroy() 292 function event.response:on_destroy() -- luacheck: ignore 212/self
293 -- Clean up incomplete upload 293 -- Clean up incomplete upload
294 if io.type(fh) == "file" then -- still open 294 if io.type(fh) == "file" then -- still open
295 fh:close(); 295 fh:close();
296 os.remove(filename.."~"); 296 os.remove(filename.."~");
297 end 297 end