mod_http_file_share: Allow started uploads to complete after token expired
authorKim Alvefur <zash@zash.se>
Thu, 28 Jan 2021 17:24:37 +0100
changeset 11338 dbba2d44fda2
parent 11337 f80056b97cf0
child 11339 b7acab5e7f57
mod_http_file_share: Allow started uploads to complete after token expired Otherwise uploads taking longer than 5 minutes would be rejected on completion, and that's probably annoying. Thanks jonas’
plugins/mod_http_file_share.lua
--- a/plugins/mod_http_file_share.lua	Thu Jan 28 17:13:49 2021 +0100
+++ b/plugins/mod_http_file_share.lua	Thu Jan 28 17:24:37 2021 +0100
@@ -169,7 +169,7 @@
 		module:log("debug", "Unauthorized or invalid token: %s, %q", authed, upload_info);
 		return 401;
 	end
-	if upload_info.exp < os.time() then
+	if not request.body_sink and upload_info.exp < os.time() then
 		module:log("debug", "Authorization token expired on %s", dt.datetime(upload_info.exp));
 		return 410;
 	end