Reformat code

This commit is contained in:
Pierre Lannoy 2023-12-21 09:38:34 +01:00
commit a0d4d86867
Signed by: Pierre Lannoy
GPG key ID: D27231EF87D53F31

View file

@ -23,7 +23,7 @@ class DohResolver {
* @param timeout {number} the number of milliseconds to wait for a response before aborting the request * @param timeout {number} the number of milliseconds to wait for a response before aborting the request
* @returns {Promise<object>} The DNS response received * @returns {Promise<object>} The DNS response received
*/ */
query(qname, qtype='TXT', timeout=null) { query(qname, qtype = 'TXT', timeout = null) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let dnsMessage = makeQuery(qname, qtype); let dnsMessage = makeQuery(qname, qtype);
sendDohMsg(dnsMessage, this.nameserver_url, timeout) sendDohMsg(dnsMessage, this.nameserver_url, timeout)
@ -41,7 +41,7 @@ class DohResolver {
* @param qtype {string} the query type to put in the query message (e.g. A, AAAA, DS, DNSKEY) * @param qtype {string} the query type to put in the query message (e.g. A, AAAA, DS, DNSKEY)
* @returns {object} The DNS query message * @returns {object} The DNS query message
*/ */
function makeQuery(qname, qtype='TXT') { function makeQuery(qname, qtype = 'TXT') {
return { return {
type: 'query', type: 'query',
id: 0, id: 0,