From 93494930ea014c8b478089faec609798e50d4780 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 27 Jan 2021 17:34:48 +0100 Subject: mod_http_file_share: Move Authorization type string It belongs with the header more than the token itself --- plugins/mod_http_file_share.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/mod_http_file_share.lua b/plugins/mod_http_file_share.lua index e6f050a9..ca835727 100644 --- a/plugins/mod_http_file_share.lua +++ b/plugins/mod_http_file_share.lua @@ -83,7 +83,7 @@ function may_upload(uploader, filename, filesize, filetype) -- > boolean, error 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 @@ function handle_slot_request(event) :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); -- cgit v1.2.3