Skip to content

Commit 2b472ff

Browse files
committed
Exclude proxy for localhost
1 parent 995729d commit 2b472ff

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

lib/W3CValidator.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ var W3CValidator = function(url, java_home) {
5656
}
5757

5858
// Get proxy
59-
if (process.env.HTTP_PROXY !== undefined) {
60-
this.httpProxy = URL(process.env.HTTP_PROXY);
61-
} else if (process.env.http_proxy !== undefined) {
62-
this.httpProxy = URL(process.env.http_proxy);
59+
if (["127.0.0.1", "localhost"].indexOf(this.crawler.host) === -1) {
60+
if (process.env.HTTP_PROXY !== undefined) {
61+
this.httpProxy = URL(process.env.HTTP_PROXY);
62+
} else if (process.env.http_proxy !== undefined) {
63+
this.httpProxy = URL(process.env.http_proxy);
64+
}
6365
}
6466

6567
// Set Crawler proxy

0 commit comments

Comments
 (0)