Skip to content

Commit 24501e8

Browse files
authored
Fix workspaces proxying bug: still need jupyter_server_proxy (#422)
* Fix bug * Revert let back to const
1 parent 05d925e commit 24501e8

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "vitessce"
7-
version = "3.5.5"
7+
version = "3.5.6"
88
authors = [
99
{ name="Mark Keller", email="[email protected]" },
1010
]

src/vitessce/widget.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,15 @@ def get_uid_str(uid):
175175
}
176176
const { origin, pathname } = new URL(window.location.href);
177177
const isInWorkspaces = origin.startsWith(WORKSPACES_URL_KEYWORD);
178-
179178
const jupyterLabConfigEl = document.getElementById('jupyter-config-data');
180179
181180
let baseUrl;
182181
if (isInWorkspaces) {
183182
const pathSegments = pathname.split('/');
184183
const passthroughIndex = pathSegments.indexOf('passthrough');
185184
if (passthroughIndex !== -1) {
186-
baseUrl = pathSegments.slice(0, passthroughIndex + 2).join('/');
185+
baseUrl = pathSegments.slice(0, passthroughIndex + 3).join('/');
186+
baseUrl += '/';
187187
}
188188
} else if (jupyterLabConfigEl) {
189189
// This is jupyter lab
@@ -196,17 +196,10 @@ def get_uid_str(uid):
196196
...config,
197197
datasets: config.datasets.map(d => ({
198198
...d,
199-
files: d.files.map(f => {
200-
if (isInWorkspaces && f.url.startsWith('proxy')) {
201-
// When the user is in workspaces, we do not use jupyter_server_proxy.
202-
// Instead, the workspaces infrastructure has its own "passthrough" functionality.
203-
f.url = f.url.replace('proxy', '');
204-
}
205-
return {
206-
...f,
207-
url: `${origin}${baseUrl}${f.url}`,
208-
};
209-
}),
199+
files: d.files.map(f => ({
200+
...f,
201+
url: `${origin}${baseUrl}${f.url}`,
202+
})),
210203
})),
211204
};
212205
}

0 commit comments

Comments
 (0)