fix: Verify legacy API redirects exist
All checks were successful
Build Docker / BuildImage (push) Successful in 54s

This fixes an infinite redirect loop
This commit is contained in:
2025-10-11 22:45:06 +11:00
parent fdb5f84c92
commit 3d5c16f9cb

View File

@@ -205,8 +205,11 @@ def links_get():
@app.route("/api/<path:function>")
def api_legacy_get(function):
# Check if function is in api blueprint
for rule in app.url_map.iter_rules():
# Check if the redirect route exists
if rule.rule == f"/api/v1/{function}":
return redirect(f"/api/v1/{function}", code=301)
return error_response(request, message="404 Not Found", code=404)
@app.route("/actions.json")