Mercurial > prosody-modules
comparison mod_invites_api/mod_invites_api.lua @ 5143:1cae382e88a1
mod_invites_api: Fix traceback when no query params (thanks Menel)
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 11 Jan 2023 10:09:12 +0000 |
| parents | 410d7c8d210d |
| children |
comparison
equal
deleted
inserted
replaced
| 5142:410d7c8d210d | 5143:1cae382e88a1 |
|---|---|
| 13 local combined_key; | 13 local combined_key; |
| 14 | 14 |
| 15 local auth_header = request.headers.authorization; | 15 local auth_header = request.headers.authorization; |
| 16 | 16 |
| 17 if not auth_header then | 17 if not auth_header then |
| 18 params = params or http_formdecode(request.url.query); | 18 params = params or http_formdecode(request.url.query or "="); |
| 19 combined_key = params.key; | 19 combined_key = params.key; |
| 20 else | 20 else |
| 21 local auth_type, value = auth_header:match("^(%S+)%s(%S+)$"); | 21 local auth_type, value = auth_header:match("^(%S+)%s(%S+)$"); |
| 22 if auth_type ~= "Bearer" then | 22 if auth_type ~= "Bearer" then |
| 23 return; | 23 return; |
