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

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