Merge pull request #307193 from K900/fix-oauth2-proxy-nginx

nixos/oauth2_proxy_nginx: fix URL escaping
This commit is contained in:
K900 2024-04-27 15:01:17 +03:00 committed by GitHub
commit 370a7b8da4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -87,9 +87,9 @@ in
"/oauth2/auth" = let
maybeQueryArg = name: value:
if value == null then null
else "${name}=${lib.concatStringsSep "," value}";
else "${name}=${lib.concatStringsSep "," (builtins.map lib.escapeURL value)}";
allArgs = lib.mapAttrsToList maybeQueryArg conf;
cleanArgs = builtins.map lib.escapeURL (builtins.filter (x: x != null) allArgs);
cleanArgs = builtins.filter (x: x != null) allArgs;
cleanArgsStr = lib.concatStringsSep "&" cleanArgs;
in {
# nginx doesn't support passing query string arguments to auth_request,