Skip to content

chore: remove regex stripping trailing slash from configured url#29

Merged
jeffsmale90 merged 1 commit into
mainfrom
chore/remove-regex
Jul 9, 2025
Merged

chore: remove regex stripping trailing slash from configured url#29
jeffsmale90 merged 1 commit into
mainfrom
chore/remove-regex

Conversation

@jeffsmale90

@jeffsmale90 jeffsmale90 commented Jul 8, 2025

Copy link
Copy Markdown
Collaborator

📝 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.ts validates this case

⚠️ Breaking Changes

  • No breaking changes
  • Breaking changes (describe below):

📋 Checklist

Check off completed items:

  • Code follows the project's coding standards
  • Self-review completed
  • Documentation updated (if needed)
  • Tests added/updated
  • Changelog updated (if needed)
  • All CI checks pass

@jeffsmale90 jeffsmale90 requested a review from a team as a code owner July 8, 2025 22:00
@jeffsmale90 jeffsmale90 force-pushed the chore/remove-regex branch from a117a1a to 08f5d70 Compare July 8, 2025 22:07
@jeffsmale90 jeffsmale90 force-pushed the chore/remove-regex branch from 08f5d70 to 100928e Compare July 8, 2025 22:34
@jeffsmale90 jeffsmale90 merged commit b082f61 into main Jul 9, 2025
14 checks passed
@jeffsmale90 jeffsmale90 deleted the chore/remove-regex branch July 9, 2025 22:10
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.

2 participants