mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-06 16:13:48 +08:00
Revert "Test fix - revert if nukes galaxy lol"
This reverts commit f51059956c.
This commit is contained in:
@@ -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}`
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user