mod_http_file_share: Move Authorization type string
authorKim Alvefur <zash@zash.se>
Wed, 27 Jan 2021 17:34:48 +0100
changeset 11326 4ade9810ce35
parent 11325 15ab878a7d23
child 11327 a853a018eede
mod_http_file_share: Move Authorization type string It belongs with the header more than the token itself
plugins/mod_http_file_share.lua
--- 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);