# HG changeset patch # User Matthew Wild # Date 1677936206 0 # Node ID 47576c73eedf3c0ec92300d5f48100b5330efaa6 # Parent afed7d5bd65ccbe8d806628b80e0696a01397e7d mod_http_oauth2: Strip trailing '/' from issuer URL diff -r afed7d5bd65c -r 47576c73eedf mod_http_oauth2/mod_http_oauth2.lua --- a/mod_http_oauth2/mod_http_oauth2.lua Fri Mar 03 22:54:46 2023 +0100 +++ b/mod_http_oauth2/mod_http_oauth2.lua Sat Mar 04 13:23:26 2023 +0000 @@ -156,7 +156,7 @@ local query = http.formdecode(redirect.query or ""); if type(query) ~= "table" then query = {}; end table.insert(query, { name = "code", value = code }); - table.insert(query, { name = "iss", value = module:http_url(nil, "/") }); + table.insert(query, { name = "iss", value = module:http_url(nil, "/"):gsub("/$", "") }); if params.state then table.insert(query, { name = "state", value = params.state }); end @@ -468,7 +468,7 @@ ["GET"] = { headers = { content_type = "application/json" }; body = json.encode { - issuer = module:http_url(nil, "/"); + issuer = module:http_url(nil, "/"):gsub("/$", ""); authorization_endpoint = handle_authorization_request and module:http_url() .. "/authorize" or nil; token_endpoint = handle_token_grant and module:http_url() .. "/token" or nil; jwks_uri = nil; -- TODO?