Diff

plugins/mod_http_file_share.lua @ 11322:4ade9810ce35

mod_http_file_share: Move Authorization type string It belongs with the header more than the token itself
author Kim Alvefur <zash@zash.se>
date Wed, 27 Jan 2021 17:34:48 +0100
parent 11321:15ab878a7d23
child 11323:a853a018eede
line wrap: on
line diff
--- a/plugins/mod_http_file_share.lua	Wed Jan 27 17:29:26 2021 +0100
+++ b/plugins/mod_http_file_share.lua	Wed Jan 27 17:34:48 2021 +0100
@@ -83,7 +83,7 @@
 end
 
 function get_authz(uploader, filename, filesize, filetype, slot)
-	return "Bearer "..jwt.sign(secret, {
+	return jwt.sign(secret, {
 		sub = uploader;
 		filename = filename;
 		filesize = filesize;
@@ -138,7 +138,7 @@
 		:tag("slot", { xmlns = namespace })
 			:tag("get", { url = slot_url }):up()
 			:tag("put", { url = upload_url })
-				:text_tag("header", authz, {name="Authorization"})
+				:text_tag("header", "Bearer "..authz, {name="Authorization"})
 		:reset();
 
 	origin.send(reply);