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

fix(registry): Prioritize route registration based on specificity #18002

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nczitzk
Copy link
Contributor

@nczitzk nczitzk commented Dec 29, 2024

Involved Issue / 该 PR 相关 Issue

Close #

Example for the Proposed Route(s) / 路由地址示例

NOROUTE

New RSS Route Checklist / 新 RSS 路由检查表

  • New Route / 新的路由
  • Anti-bot or rate limit / 反爬/频率限制
    • If yes, do your code reflect this sign? / 如果有, 是否有对应的措施?
  • Date and time / 日期和时间
    • Parsed / 可以解析
    • Correct time zone / 时区正确
  • New package added / 添加了新的包
  • Puppeteer

Note / 说明

A sortRoutes function has been introduced to prioritize route registration based on segment type and order. Literal segments are prioritized over parameter segments, ensuring that more specific routes are registered first.

For instance, with the routes /xxx/news/:channel and /xxx/:category, a request to /xxx/news/sports will now correctly match /xxx/news/:channel, while a request to /xxx/products will match /xxx/:category.

Copy link
Collaborator

@TonyRL TonyRL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docker container can't start

@github-actions github-actions bot added the Auto: Route Test Skipped PR involves no routes label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants