Add case for when user agent is nil

Add test for nil user agent
This commit is contained in:
briankopp 2020-02-16 10:10:18 -06:00
parent 37c24b0df5
commit b2beeeab25
2 changed files with 7 additions and 1 deletions

View file

@ -13,7 +13,9 @@ local _M = {}
-- browsers which will reject SameSite=None cookies.
-- reference: https://www.chromium.org/updates/same-site/incompatible-clients
function _M.same_site_none_compatible(user_agent)
if string.match(user_agent, "Chrome/4") then
if not user_agent then
return true
elseif string.match(user_agent, "Chrome/4") then
return false
elseif string.match(user_agent, "Chrome/5") then
return false