From edf76af7969b84bcae4aae1534f33abeb590f7b8 Mon Sep 17 00:00:00 2001 From: firestarsdog <229254897+firestarsdog@users.noreply.github.com> Date: Sat, 5 Sep 2026 22:28:13 -0400 Subject: [PATCH] Revert "Test fix - revert if nukes galaxy lol" This reverts commit f51059956c924e177395b0b4c33d4b411aec13fb. --- starpilot/system/the_galaxy/assets/js/utils.js | 8 +++++++- starpilot/system/the_galaxy/the_galaxy.py | 12 ------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/starpilot/system/the_galaxy/assets/js/utils.js b/starpilot/system/the_galaxy/assets/js/utils.js index 37d86cb96..b00d24aac 100644 --- a/starpilot/system/the_galaxy/assets/js/utils.js +++ b/starpilot/system/the_galaxy/assets/js/utils.js @@ -89,5 +89,11 @@ export function isGalaxyTunnel() { } export function galaxyPath(path) { - return path.startsWith("/") ? path : `/${path}` + const suffix = path.startsWith("/") ? path : `/${path}` + if (!isGalaxyTunnel()) return suffix + + const firstPathSegment = window.location.pathname.split("/").filter(Boolean)[0] || "" + const slug = /^[A-Za-z0-9]{16}$/.test(firstPathSegment) ? `/${firstPathSegment}` : "" + if (!slug || suffix === slug || suffix.startsWith(`${slug}/`)) return suffix + return `${slug}${suffix}` } diff --git a/starpilot/system/the_galaxy/the_galaxy.py b/starpilot/system/the_galaxy/the_galaxy.py index dfef5e33e..3b12cad4c 100644 --- a/starpilot/system/the_galaxy/the_galaxy.py +++ b/starpilot/system/the_galaxy/the_galaxy.py @@ -5005,18 +5005,6 @@ def setup(app): @app.errorhandler(404) def not_found(_): - is_api = ( - request.path == "/api" - or "/api/" in request.path - or request.is_json - or (request.accept_mimetypes.accept_json and not request.accept_mimetypes.accept_html) - ) - if is_api or request.method not in ("GET", "HEAD"): - return jsonify({"error": "Not found"}), 404 - - if request.path.startswith(("/assets/", "/screen_recordings/", "/thumbnails/", "/video/")): - return "Not found", 404 - response = make_response(render_template("index.html")) response.headers["Cache-Control"] = "no-store, no-cache, must-revalidate, max-age=0" response.headers["Pragma"] = "no-cache"