copilot fix

This commit is contained in:
chiloute
2026-07-28 11:17:47 +02:00
committed by GitHub
parent 984e2f88c8
commit 717ea26b94
+2 -2
View File
@@ -54,7 +54,7 @@ end
local function decode_jwt_payload(value) local function decode_jwt_payload(value)
-- Three dot-separated base64url segments; the signature may be empty (alg:none). -- Three dot-separated base64url segments; the signature may be empty (alg:none).
local payload = value:match("^[A-Za-z0-9_-]+%.([A-Za-z0-9_-]+)%.[A-Za-z0-9_-]*$") local payload = value:match("^[A-Za-z0-9_-]+%.([A-Za-z0-9_-]+)%.[A-Za-z0-9_-]*$")
if not payload then if not payload or #payload > 8192 then
return nil return nil
end end
local decoded = b64url_decode(payload) local decoded = b64url_decode(payload)
@@ -65,7 +65,7 @@ local function decode_jwt_payload(value)
if decoded:match("^%s*{") == nil then if decoded:match("^%s*{") == nil then
return nil return nil
end end
decoded = decoded:gsub("[\r\n]+", " ") decoded = decoded:gsub("[%c]+", " ")
return decoded return decoded
end end