-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(snaps): Patch
@metamask/snaps-utils
(#28377)
## **Description** This PR patches the `@metamask/snaps-utils` package after MetaMask/snaps#2876. [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28377?quickstart=1) ## **Related issues** ## **Manual testing steps** ## **Screenshots/Recordings** ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
- Loading branch information
1 parent
54588f9
commit d876ccb
Showing
3 changed files
with
46 additions
and
22 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
.yarn/patches/@metamask-snaps-utils-npm-8.4.1-90481bac4b.patch
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
diff --git a/dist/json-rpc.cjs b/dist/json-rpc.cjs | ||
index 6061f7b8b42f0521b0718d616e5a12a1a7520068..11d0233a7bd4b610a99da6a3d105840e88e108e6 100644 | ||
--- a/dist/json-rpc.cjs | ||
+++ b/dist/json-rpc.cjs | ||
@@ -68,7 +68,7 @@ function createOriginRegExp(matcher) { | ||
const escaped = matcher.replace(/[.*+?^${}()|[\]\\]/gu, '\\$&'); | ||
// Support wildcards | ||
const regex = escaped.replace(/\\\*/gu, '.*'); | ||
- return RegExp(`${regex}$`, 'u'); | ||
+ return RegExp(`^${regex}$`, 'u'); | ||
} | ||
/** | ||
* Check whether an origin is allowed or not using a matcher string. | ||
diff --git a/dist/json-rpc.mjs b/dist/json-rpc.mjs | ||
index bfa1c2dbbed46a2221ef708afdb97b15db84bc1b..81bc2150cf5d6a9bdabe8d43b04352b299bc1c4d 100644 | ||
--- a/dist/json-rpc.mjs | ||
+++ b/dist/json-rpc.mjs | ||
@@ -63,7 +63,7 @@ function createOriginRegExp(matcher) { | ||
const escaped = matcher.replace(/[.*+?^${}()|[\]\\]/gu, '\\$&'); | ||
// Support wildcards | ||
const regex = escaped.replace(/\\\*/gu, '.*'); | ||
- return RegExp(`${regex}$`, 'u'); | ||
+ return RegExp(`^${regex}$`, 'u'); | ||
} | ||
/** | ||
* Check whether an origin is allowed or not using a matcher string. |
This file contains 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
This file contains 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