Test fix - revert if nukes galaxy lol

This commit is contained in:
firestarsdog
2026-09-05 19:18:02 -04:00
parent 3fba6a4968
commit 5d0e3acb61
2 changed files with 13 additions and 7 deletions
@@ -89,11 +89,5 @@ export function isGalaxyTunnel() {
}
export function galaxyPath(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}`
return path.startsWith("/") ? path : `/${path}`
}
+12
View File
@@ -5005,6 +5005,18 @@ 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"