1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Fix site metadata JSON-RPC handler (#10243)

* Fix getting the site metadata from the request origin params.

Regressed from inpage-provider ts migration the request. The property domainMetadata is now set as a params key for the request.

https://github.com/MetaMask/inpage-provider/blob/v7.0.0/src/siteMetadata.js#L19-L25
vs
https://github.com/MetaMask/inpage-provider/blob/main/src/siteMetadata.ts#L19-L27

* Change hardcoded mocked response of the request to the prod response.
This commit is contained in:
Thomas Huang 2021-01-22 10:27:07 -08:00 committed by Mark Stacey
parent ae5ee105bf
commit a88a087b60
2 changed files with 3 additions and 3 deletions

View File

@ -74,8 +74,8 @@ export default function createPermissionsMethodMiddleware({
// custom method for getting metadata from the requesting domain,
// sent automatically by the inpage provider when it's initialized
case 'metamask_sendDomainMetadata': {
if (typeof req.domainMetadata?.name === 'string') {
addDomainMetadata(req.origin, req.domainMetadata)
if (typeof req.params?.name === 'string') {
addDomainMetadata(req.origin, req.params)
}
res.result = true
return

View File

@ -600,7 +600,7 @@ export const getters = deepFreeze({
return {
origin,
method: 'metamask_sendDomainMetadata',
domainMetadata: {
params: {
...args,
name,
},