Skip to content

Commit 7dbfd4f

Browse files
Peter XiePeter Xie
authored andcommitted
fix bug for local IP address
1 parent 9ffe6f3 commit 7dbfd4f

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

app/server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ const myIpServer = (CallBack) => {
116116
let ret = false;
117117
Async.each(myIpServerUrl, (n, next) => {
118118
doUrl(n, (err, data) => {
119-
if (err) {
119+
if (err || !Net.isIPv4(data)) {
120120
return next();
121121
}
122122
if (!ret) {
@@ -125,7 +125,7 @@ const myIpServer = (CallBack) => {
125125
}
126126
});
127127
}, () => {
128-
return CallBack(new Error(''));
128+
return CallBack(new Error('no IP'));
129129
});
130130
};
131131
const getQTGateSign = (_key) => {

app/server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,16 @@ const myIpServer = ( CallBack ) => {
131131
let ret = false
132132
Async.each ( myIpServerUrl, ( n, next ) => {
133133
doUrl( n, ( err, data ) => {
134-
if ( err ) {
134+
if ( err || ! Net.isIPv4 ( data )) {
135135
return next ()
136136
}
137-
if ( !ret ) {
137+
if ( ! ret ) {
138138
ret = true
139139
return CallBack ( null, data )
140140
}
141141
})
142142
}, () => {
143-
return CallBack ( new Error (''))
143+
return CallBack ( new Error ('no IP'))
144144
})
145145
}
146146

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "qtgate",
3-
"version": "0.8.54",
3+
"version": "0.8.55",
44
"license": "MIT",
55
"description": "QTGate desktop client",
66
"scripts": {

0 commit comments

Comments
 (0)