chore: remove regex stripping trailing slash from configured url#29
Merged
Conversation
a117a1a to
08f5d70
Compare
08f5d70 to
100928e
Compare
hanzel98
approved these changes
Jul 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
When configuring the delegation storage client, a regex is used to strip trailing slashes from the provided URL. This change removes that and replaces it with a bounded mechanism.
🔄 What Changed?
Regex stripping trailing slashes was replaced with mechanism that inserts a separating slash if one doesn't exist on the provided URL.
🚀 Why?
Resolves https://github.com/MetaMask/delegation-toolkit/security/code-scanning/2 polynomial regex expression.
🧪 How to Test?
No changes in behaviour.
Configuring the delegation storage url with a trailing '/' should continue to work.
"accepts an apiUrl with a trailing slash" added to
packages/delegation-toolkit/test/experimental/delegationStorage.test.tsvalidates this case📋 Checklist
Check off completed items: