Software /
code /
prosody
Comparison
plugins/mod_http_file_share.lua @ 11335:b7acab5e7f57
mod_http_file_share: Clarify message about missing Authorization header
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 29 Jan 2021 15:34:15 +0100 |
parent | 11334:dbba2d44fda2 |
child | 11336:b05331cff47a |
comparison
equal
deleted
inserted
replaced
11334:dbba2d44fda2 | 11335:b7acab5e7f57 |
---|---|
159 local authz = request.headers.authorization; | 159 local authz = request.headers.authorization; |
160 if authz then | 160 if authz then |
161 authz = authz:match("^Bearer (.*)") | 161 authz = authz:match("^Bearer (.*)") |
162 end | 162 end |
163 if not authz then | 163 if not authz then |
164 module:log("debug", "Missing Authorization"); | 164 module:log("debug", "Missing or malformed Authorization header"); |
165 return 403; | 165 return 403; |
166 end | 166 end |
167 local authed, upload_info = jwt.verify(secret, authz); | 167 local authed, upload_info = jwt.verify(secret, authz); |
168 if not (authed and type(upload_info) == "table" and type(upload_info.exp) == "number") then | 168 if not (authed and type(upload_info) == "table" and type(upload_info.exp) == "number") then |
169 module:log("debug", "Unauthorized or invalid token: %s, %q", authed, upload_info); | 169 module:log("debug", "Unauthorized or invalid token: %s, %q", authed, upload_info); |