Software /
code /
prosody-modules
Diff
mod_http_oauth2/mod_http_oauth2.lua @ 5224:cd5cf4cc6304
mod_http_oauth2: Fail early when no authorization header present
Fixes traceback.
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 07 Mar 2023 15:31:19 +0000 |
parent | 5223:8b2a36847912 |
child | 5225:3439eb37f23b |
line wrap: on
line diff
--- a/mod_http_oauth2/mod_http_oauth2.lua Tue Mar 07 15:27:50 2023 +0000 +++ b/mod_http_oauth2/mod_http_oauth2.lua Tue Mar 07 15:31:19 2023 +0000 @@ -342,6 +342,8 @@ end local function get_request_credentials(request) + if not request.headers.authorization then return; end + local auth_type, auth_data = string.match(request.headers.authorization, "^(%S+)%s(.+)$"); if auth_type == "Basic" then