Skip to content

fix: prefer exact path match over parameterized match for method checking#2921

Open
themavik wants to merge 1 commit intolabstack:masterfrom
themavik:fix/2547-route-detection-405
Open

fix: prefer exact path match over parameterized match for method checking#2921
themavik wants to merge 1 commit intolabstack:masterfrom
themavik:fix/2547-route-detection-405

Conversation

@themavik
Copy link

Summary

  • Fix route matching to prefer exact path matches over parameterized matches when checking HTTP methods
  • Previously, a POST to /VerifiedCallerId/Verification/ would match GET VerifiedCallerId/:phone_number and return 405

Root Cause

The router matches parameterized routes before checking for exact matches at the same path level. This causes incorrect 405 responses when an exact match exists for a different method.

Testing

  • Added test case for the reported scenario

Fixes #2547

Made with Cursor

@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.02%. Comparing base (19364e2) to head (4da962d).
⚠️ Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2921      +/-   ##
==========================================
+ Coverage   93.01%   93.02%   +0.01%     
==========================================
  Files          43       43              
  Lines        4496     4503       +7     
==========================================
+ Hits         4182     4189       +7     
  Misses        196      196              
  Partials      118      118              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Not able to detect the route url without \

1 participant