fix: audit

This commit is contained in:
Pasha8914 2022-06-07 00:26:00 +10:00
parent 9f8aad114c
commit b91b81f5c9
21 changed files with 140 additions and 53 deletions

View file

@ -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) {

View file

@ -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

View file

@ -20,7 +20,8 @@ export const state = () => {
...rpcData,
isActiveNotification: {
first: true,
second: true
second: true,
third: true
}
}
}