Skip to content

Commit 19c1905

Browse files
author
David White
committed
Bump version, and apiServer update
Found a reasonable bug in fluxport-controller state management, so have bumped verison to pull that in. Small refactor to ipv4 adress check
1 parent 1f357e7 commit 19c1905

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

apiServer.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ let initialHash = hash(fs.readFileSync(path.join(__dirname, '/config/userconfig.
2424

2525
function validIpv4Address(ip) {
2626
const ipv4Regex = /^(\d{1,3}\.){3}\d{1,3}$/;
27-
if (ipv4Regex.test(ip)) {
28-
const parts = ip.split('.');
29-
// eslint-disable-next-line no-restricted-syntax
30-
for (const part of parts) {
31-
if (parseInt(part, 10) > 255) {
32-
return false;
33-
}
34-
}
27+
28+
if (!ipv4Regex.test(ip)) return false;
29+
30+
const parts = ip.split('.');
31+
32+
const isValid = parts.every((part) => {
33+
if (parseInt(part, 10) > 255) return false;
3534
return true;
36-
}
37-
return false;
35+
})
36+
37+
return isValid;
3838
}
3939

4040
function validateTags() {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"docs": "jsdoc -d docs --configure jsconf.json -r"
7373
},
7474
"dependencies": {
75-
"@megachips/fluxport-controller": "^0.0.20",
75+
"@megachips/fluxport-controller": "^0.1.0",
7676
"@megachips/nat-upnp": "^1.1.1",
7777
"apicache": "~1.6.3",
7878
"archiver": "~6.0.1",

0 commit comments

Comments
 (0)