comparison mod_rest/mod_rest.lua @ 4526:23b681214be3

mod_rest: Remove inaccurate comment It also checks Basic auth here. Removing since it doesn't seem to add much.
author Kim Alvefur <zash@zash.se>
date Tue, 23 Mar 2021 20:23:35 +0100
parents 81d0748bff5b
children 183c2abdc3c4
comparison
equal deleted inserted replaced
4525:b68b801ddc50 4526:23b681214be3
29 header[#header+1] = ("%s realm=%q"):format(mech, realm); 29 header[#header+1] = ("%s realm=%q"):format(mech, realm);
30 end 30 end
31 www_authenticate_header = table.concat(header, ", "); 31 www_authenticate_header = table.concat(header, ", ");
32 end 32 end
33 33
34 -- Bearer token
35 local function check_credentials(request) 34 local function check_credentials(request)
36 local auth_type, auth_data = string.match(request.headers.authorization, "^(%S+)%s(.+)$"); 35 local auth_type, auth_data = string.match(request.headers.authorization, "^(%S+)%s(.+)$");
37 if not (auth_type and auth_data) or not auth_mechanisms:contains(auth_type) then 36 if not (auth_type and auth_data) or not auth_mechanisms:contains(auth_type) then
38 return false; 37 return false;
39 end 38 end