Closed charliegriefer closed 3 months ago
Simple fix. Just add both routes in the view.
@main_blueprint.route("/<username>/bottles", methods=["GET", "POST"], endpoint="list_bottles")
@main_blueprint.route("/<username>/bottles/", methods=["GET", "POST"], endpoint="list_bottles")
Another option... use the strict_slashes
attribute:
@main_blueprint.route("/<username>/bottles", methods=["GET", "POST"], endpoint="list_bottles", strict_slashes=False)
Conclusion: Implement the strict_slashes
solution.
The following URL results in a 404:
http://my-whiskies.online/charlie/bottles/
The issue is Flask expects a route after the trailing slash. But no route should be the same call as:
http://my-whiskies.online/charlie/bottles