Skip to content

Commit 4a02aae

Browse files
committed
More static routing fixes
1 parent bb77326 commit 4a02aae

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

viewer/src/components/copy_link.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ export default function CopyUrl({
3232
let path = origin_path
3333
? window.location.pathname.split(origin_path)[0]
3434
: window.location.pathname;
35+
if (path.includes(import.meta.env.VITE_XREDS_BASE_URL)) {
36+
path = path.replace(import.meta.env.VITE_XREDS_BASE_URL, '');
37+
}
3538
if (path.endsWith('/')) {
3639
path = path.slice(0, -1);
3740
}
@@ -59,6 +62,9 @@ export default function CopyUrl({
5962
origin_path,
6063
)[0]
6164
: window.location.pathname;
65+
if (path.includes(import.meta.env.VITE_XREDS_BASE_URL)) {
66+
path = path.replace(import.meta.env.VITE_XREDS_BASE_URL, '');
67+
}
6268
if (path.endsWith('/')) {
6369
path = path.slice(0, -1);
6470
}

xreds/spastaticfiles.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ class SPAStaticFiles(StaticFiles):
1111

1212
async def get_response(self, path: str, scope):
1313
try:
14-
if (
15-
not path.endswith(".js")
16-
and not path.endswith(".css")
17-
and not path.endswith(".html")
18-
):
14+
if not '.' in path:
1915
raise HTTPException(status_code=404)
2016
return await super().get_response(path, scope)
2117
except HTTPException as ex:

0 commit comments

Comments
 (0)