Skip to content

Commit ae3bc54

Browse files
committed
deal with Authorization headers without blank
closes #473 Signed-off-by: Stefan Bodewig <[email protected]>
1 parent 4ff4189 commit ae3bc54

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

ChangeLog

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
03/02/2023
1+
03/10/2023
2+
- when looking for a bearer token an exception occured if the
3+
Authorization header didn't contain any space character;
4+
see #473
5+
6+
02/03/2023
27
- release 1.7.6-3 of luarock pinning lua-resty-session dependency to
38
not go beyond 3.1ß
49

lib/resty/openidc.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -1651,7 +1651,7 @@ local function openidc_get_bearer_access_token(opts)
16511651
end
16521652

16531653
local divider = header:find(' ')
1654-
if divider == 0 or string.lower(header:sub(0, divider - 1)) ~= string.lower("Bearer") then
1654+
if divider == nil or divider == 0 or string.lower(header:sub(0, divider - 1)) ~= string.lower("Bearer") then
16551655
err = "no Bearer authorization header value found"
16561656
log(ERROR, err)
16571657
return nil, err

0 commit comments

Comments
 (0)