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

Inconsistent slashes in Blueprint #2514

Closed
ahopkins opened this issue Jul 31, 2022 · 0 comments · Fixed by #2515
Closed

Inconsistent slashes in Blueprint #2514

ahopkins opened this issue Jul 31, 2022 · 0 comments · Fixed by #2515

Comments

@ahopkins
Copy link
Member

Describe the bug
There is an inconsistency with how slashes are handled in blueprints when strict_slashes applied in different manner.

Code snippet

@app.before_server_start
async def display(_):
    for route in app.router.routes:
        print(route)

The following yields: <Route: name=__main__.bp.index path=foo/>

This is correct ✔️

bp = Blueprint("bp", url_prefix="/foo/", strict_slashes=True)

@bp.get("/")
async def handler(_):
    ...

And this yields: <Route: name=__main__.bp.index path=foo//>

This is incorrect ❌

@bp.get("/")
async def index(_):
    ...


app.blueprint(bp, url_prefix="/foo/", strict_slashes=True)

Expected behavior
Applying prefix with static_slashes in app.blueprint is the same as in Blueprint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant