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

[http-server-javascript] Fix an annoying bug with router path matching. #4115

Merged

Conversation

witemple-msft
Copy link
Member

This PR fixes a bug where path parameters in the middle of a path would fail to match because they incorrectly removed the leading "/" from the rest of the path segment after matching. The "/" trailing a parameter was never included as part of the path but was discarded by a call to String.split. The logic in this PR is more robust, always using indices and slices.

@azure-sdk
Copy link
Collaborator

All changed packages have been documented.

  • @typespec/http-server-javascript
Show changes

typespec-vs - fix ✏️

Fixed a router bug where paths would sometimes fail to match after a parameter was bound.

@typespec/http-server-javascript - fix ✏️

Fixed a router bug where paths would sometimes fail to match after a parameter was bound.

@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 📚 Next docs

@witemple-msft witemple-msft added this pull request to the merge queue Aug 7, 2024
Merged via the queue into microsoft:main with commit dae509f Aug 7, 2024
22 checks passed
@witemple-msft witemple-msft deleted the witemple-msft/hsj-router-param-bug branch August 7, 2024 20:27
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.

4 participants