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: update HTTP routing to longest matching prefix wins #1109

Merged
merged 1 commit into from Feb 6, 2023

Conversation

fibonacci1729
Copy link
Contributor

Today, HTTP routing in Spin is dependent upon the ordering of component configs in spin.toml. This PR evolves the HTTP routing algorithm to longest matching prefix wins where exact matches take highest precedence followed by longest matching wildcard patterns.

test_router is updated in place to reflect the new algorithm.

Signed-off-by: Brian H brian.hardock@fermyon.com

@fibonacci1729
Copy link
Contributor Author

Closes #1098

@lann
Copy link
Collaborator

lann commented Feb 6, 2023

Docs should be updated to match

Copy link
Contributor

@itowlson itowlson left a comment

Choose a reason for hiding this comment

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

The request changes is specifically for the testing - the other comment is a question/suggestion/think out loud and is definitely not a blocker!

crates/http/src/routes.rs Show resolved Hide resolved
crates/http/src/routes.rs Show resolved Hide resolved
Copy link
Contributor

@itowlson itowlson left a comment

Choose a reason for hiding this comment

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

Thanks!

Signed-off-by: Brian H <brian.hardock@fermyon.com>
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.

None yet

3 participants