Skip to content

Commit

Permalink
fix(app): extract the DISABLE_HTTP to a variable
Browse files Browse the repository at this point in the history
I can easily enclose the statement, but I don't prefer to do that.

This fixed #140
  • Loading branch information
pan93412 committed Sep 6, 2021
1 parent 87ff628 commit 35a89fb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,11 @@ const httpdns2 = (host) =>
.reduce((result, value) => result.concat(value.ip || []), [])
);

const dnsSource = process.env.DISABLE_HTTPDNS !== 'true' ? [httpdns, httpdns2] : [];

Promise.all(
// Allow disabling HTTPDNS queries with `DISABLE_HTTPDNS=true`
process.env.DISABLE_HTTPDNS !== 'true' ? [httpdns, httpdns2] : []
dnsSource
.map((query) => query(target.join(',')))
.concat(target.map(dns))
)
Expand Down

0 comments on commit 35a89fb

Please sign in to comment.