fix: audit
This commit is contained in:
parent
9f8aad114c
commit
b91b81f5c9
21 changed files with 140 additions and 53 deletions
|
@ -82,6 +82,8 @@ const mutations = {
|
|||
},
|
||||
SET_NET_ID(state, netId) {
|
||||
netId = parseInt(netId, 10)
|
||||
window.localStorage.setItem('netId', netId)
|
||||
|
||||
state.netId = netId
|
||||
},
|
||||
SET_RECONNECTING(state, bool) {
|
||||
|
|
|
@ -337,13 +337,15 @@ export const actions = {
|
|||
async getCustomRelayerData({ rootState, state, getters, rootGetters, dispatch }, { url, name }) {
|
||||
const provider = getters.ethProvider.eth
|
||||
|
||||
if (!url.startsWith('https:') && !url.startsWith('http:')) {
|
||||
if (url.includes('.onion')) {
|
||||
const PROTOCOL_REGEXP = /^(http(s?))/
|
||||
if (!PROTOCOL_REGEXP.test(url)) {
|
||||
if (url.endsWith('.onion')) {
|
||||
url = `http://${url}`
|
||||
} else {
|
||||
url = `https://${url}`
|
||||
}
|
||||
}
|
||||
|
||||
const urlParser = new URL(url)
|
||||
urlParser.href = url
|
||||
let ensName = name
|
||||
|
|
|
@ -20,7 +20,8 @@ export const state = () => {
|
|||
...rpcData,
|
||||
isActiveNotification: {
|
||||
first: true,
|
||||
second: true
|
||||
second: true,
|
||||
third: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue