Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin endpoint seems to be reserved #5676

Closed
madprops opened this issue Feb 8, 2025 · 2 comments
Closed

Admin endpoint seems to be reserved #5676

madprops opened this issue Feb 8, 2025 · 2 comments

Comments

@madprops
Copy link

madprops commented Feb 8, 2025

@app.route("/admin/<password>/<int:page>", methods=["GET"])
def admin(password: str, page: int = 1) -> Any:
    print(page)
    files, total = [], 2
    return render_template("admin.html", files=files, password=password, total=total)

This fails when page is 1,2,3 or 8.

At least. it might fail in more cases.

If page is 4 or 5, 9, etc, it works.

By works I mean, it uses the actual argument instead of the default: 1

I'm guessing the admin endpoint is being reserved in some way, but should it?

If I replace 'admin' to 'pok' for example:

@app.route("/pok/<password>/<int:page>", methods=["GET"])

Then it works as expected.

Environment:

  • Python version: 3.13.1
  • Flask version: 3.1.0
@davidism
Copy link
Member

davidism commented Feb 8, 2025

Flask does not reserve any routes. You're probably using an extension that does.

@davidism davidism closed this as not planned Won't fix, can't repro, duplicate, stale Feb 8, 2025
@madprops
Copy link
Author

madprops commented Feb 8, 2025

Just to add some information. Whatever is reserving it only messes up when the password is change_me.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants