mod_http_oauth2: Fix appending of query parts in error redirects
Looks like this meant to check whether the redirect_uri has a ?query
part, but forgot to inspect the field for this in the returned table.
--- a/mod_http_oauth2/mod_http_oauth2.lua Thu Mar 09 14:46:06 2023 +0100
+++ b/mod_http_oauth2/mod_http_oauth2.lua Fri Mar 10 11:54:30 2023 +0100
@@ -429,7 +429,7 @@
return render_page(templates.error, { error = err });
end
local redirect_query = url.parse(redirect_uri);
- local sep = redirect_query and "&" or "?";
+ local sep = redirect_query.query and "&" or "?";
redirect_uri = redirect_uri
.. sep .. http.formencode(err.extra.oauth2_response)
.. "&" .. http.formencode({ state = q.state, iss = get_issuer() });