forked from swan-cern/jupyter-images
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To prevent double formatting of environment variables. See PR upstream: jupyterhub/jupyter-server-proxy#437
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
From 40a37b3698ab1dfa6b5688312721262008196bb5 Mon Sep 17 00:00:00 2001 | ||
From: Diogo Castro <[email protected]> | ||
Date: Thu, 7 Dec 2023 12:30:49 +0100 | ||
Subject: [PATCH] Only format a proxy environment once | ||
|
||
It was doing double formatting, which broke when passing environment variables with escaped strings (i.e {{var}}). | ||
--- | ||
jupyter_server_proxy/handlers.py | 4 +--- | ||
1 file changed, 1 insertion(+), 3 deletions(-) | ||
|
||
diff --git a/jupyter_server_proxy/handlers.py b/jupyter_server_proxy/handlers.py | ||
index db57222b..2890dc3a 100644 | ||
--- a/jupyter_server_proxy/handlers.py | ||
+++ b/jupyter_server_proxy/handlers.py | ||
@@ -654,9 +654,7 @@ def _render_template(self, value): | ||
def _realize_rendered_template(self, attribute): | ||
"""Call any callables, then render any templated values.""" | ||
if callable(attribute): | ||
- attribute = self._render_template( | ||
- call_with_asked_args(attribute, self.process_args) | ||
- ) | ||
+ attribute = call_with_asked_args(attribute, self.process_args) | ||
return self._render_template(attribute) | ||
|
||
@web.authenticated | ||
|