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

Very explicitly describe the URL dispatcher sequential search nature #4256

Closed
asvetlov opened this issue Oct 22, 2019 · 3 comments
Closed

Very explicitly describe the URL dispatcher sequential search nature #4256

asvetlov opened this issue Oct 22, 2019 · 3 comments
Labels
documentation Improvements or additions to documentation Hacktoberfest We think it's good for https://hacktoberfest.digitalocean.com/

Comments

@asvetlov
Copy link
Member

aiohttp tries to match URL to web-handler in the order of resources (routes) addition.
Documentation should be very clear at this point.

For example /{name}, /info always matches to /{name}, /info router has no chance to be called.
On the opposite, /info, /{name} calls web handler for /{name} only if name!='info', inother words if /info handler didn't match.

The same is true for sub-apps; app.add_subapp('/pre', subapp) matches all /pre/* paths.

app.add_subapp('/pre', subapp)
app.add_routes('/pre/path', handler)

In the example above a handler for /pre/path is never matched.

A champion for documentation upgrade is needed. I don't know where we should put this chapter; this is a subject for discussion.

Related: #4078

@asvetlov asvetlov added documentation Improvements or additions to documentation Hacktoberfest We think it's good for https://hacktoberfest.digitalocean.com/ labels Oct 22, 2019
@xypnox
Copy link

xypnox commented Oct 22, 2019

Hi, I would like to add the documentation for this issue.

An apt place where we can add this would be where we introduce variable routes.

@asvetlov
Copy link
Member Author

Agree, please use a separate chapter next to Variable Routes.

@Dreamsorcerer
Copy link
Member

This behaviour doesn't happen since we rewrote the routing algorithm for better performance in #7829.

@Dreamsorcerer Dreamsorcerer closed this as not planned Won't fix, can't repro, duplicate, stale Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation Hacktoberfest We think it's good for https://hacktoberfest.digitalocean.com/
Projects
None yet
Development

No branches or pull requests

3 participants