Skip to content

Commit b217e54

Browse files
committed
Prevent double url prefixing
1 parent 24501e8 commit b217e54

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
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.6"
7+
version = "3.5.7"
88
authors = [
99
{ name="Mark Keller", email="[email protected]" },
1010
]

src/vitessce/widget.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def get_uid_str(uid):
163163
const { createRoot } = await importWithMap("react-dom/client", importMap);
164164
165165
const e = React.createElement;
166-
const WORKSPACES_URL_KEYWORD = 'https://workspaces-pt'
166+
const WORKSPACES_URL_KEYWORD = 'https://workspaces-pt';
167167
const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
168168
// The jupyter server may be running through a proxy,
169169
// which means that the client needs to prepend the part of the URL before /proxy/8000 such as
@@ -198,7 +198,10 @@ def get_uid_str(uid):
198198
...d,
199199
files: d.files.map(f => ({
200200
...f,
201-
url: `${origin}${baseUrl}${f.url}`,
201+
url: (!(f.url.startsWith('http://') || f.url.startsWith('https://'))
202+
? `${origin}${baseUrl}${f.url}`
203+
: f.url
204+
),
202205
})),
203206
})),
204207
};

0 commit comments

Comments
 (0)