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

router: fix multi-pattern and path tail matches #366

Merged
merged 5 commits into from
Jul 16, 2021

Conversation

aliemjay
Copy link
Member

@aliemjay aliemjay commented Jun 27, 2021

PR Type

Bug fix

PR Checklist

Check your PR fulfills the following:

  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • A changelog entry has been made for the appropriate packages.
  • Format code with the latest stable rustfmt

Overview

In muti-pattern, static patterns are accidentaly interpreted as regex. This is fixed by adding a flag to parse() (force_dynamic) to force it to always escape and render the pattern as regex even when it is static.

This also fixes the case when static path tail (/*) is used after a dynamic segment:

/static/* ... already works
/{user}* ... already works; stores the path tail in user
/{user}/* ... doesn't work as expected.

Please see failing tests and linked issue.

Closes actix/actix-web#1647

@aliemjay aliemjay mentioned this pull request Jun 27, 2021
4 tasks
@aliemjay
Copy link
Member Author

@robjtede I added one more commit of related refactoring. I'm unsure if you want it in another PR.

Copy link
Member

@robjtede robjtede left a comment

Choose a reason for hiding this comment

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

great work

@robjtede robjtede merged commit 5b1ff30 into actix:master Jul 16, 2021
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 this pull request may close these issues.

resource multi-patterns act as prefixes by default
2 participants