From d42075072b9a1ed192ee344d09fac6c02068da7c Mon Sep 17 00:00:00 2001 From: h345983745 Date: Wed, 6 Feb 2019 20:54:06 +0000 Subject: [PATCH] Small Updates --- src/core/operations/DNSOverHTTPS.mjs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/core/operations/DNSOverHTTPS.mjs b/src/core/operations/DNSOverHTTPS.mjs index 70b779f1..f2c7203a 100644 --- a/src/core/operations/DNSOverHTTPS.mjs +++ b/src/core/operations/DNSOverHTTPS.mjs @@ -24,6 +24,7 @@ class HTTPSOverDNS extends Operation { this.infoURL = "https://en.wikipedia.org/wiki/DNS_over_HTTPS"; this.inputType = "string"; this.outputType = "JSON"; + this.manualBake = true; this.args = [ { name: "Resolver", @@ -69,13 +70,16 @@ class HTTPSOverDNS extends Operation { */ run(input, args) { const [resolver, requestType, justAnswer, DNSSEC] = args; - - var url = new URL(resolver); + try{ + var url = new URL(resolver); + } catch (error) { + throw new OperationError(error.toString() + + "\n\nThis error could be caused by one of the following:\n" + + " - An invalid Resolver URL\n" ) + } var params = {name:input, type:requestType, cd:DNSSEC}; - url.search = new URLSearchParams(params) - console.log(url.toString()) return fetch(url, {headers:{'accept': 'application/dns-json'}}).then(response => {return response.json()}) .then(data => { @@ -84,7 +88,7 @@ class HTTPSOverDNS extends Operation { } return data; - }).catch(e => {throw new OperationError("Error making request to " + url + e.toString())}) + }).catch(e => {throw new OperationError("Error making request to :" + url + e.toString())}) }