Commit 67c0d1117898997e044bdf04b8b95e4b498ae8aa

Authored by Adhidarma Hadiwinoto
1 parent ae51086d23
Exists in master

Perbaikan deteksi ip

Showing 1 changed file with 1 additions and 2 deletions Side-by-side Diff

... ... @@ -2,7 +2,6 @@
2 2  
3 3 process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
4 4  
5   -const URL = require('url');
6 5 const fs = require('fs');
7 6 const isIp = require('is-ip');
8 7 const config = require(__dirname + '/config.json');
... ... @@ -25,7 +24,7 @@ for (let i=0; i < hostsCount; i++) {
25 24 }
26 25 else {
27 26  
28   - if (isIp(URL.parse(host.host).hostname)) {
  27 + if (isIp(host.host.split('/')[0])) {
29 28 console.log('Register ' + host.host + ' without SSL')
30 29 redbird.register(host.host, host.target, optionsWoSSL);
31 30 }