Commit de9e91d
authored
fix(ns-plug): inventory, better public IP retrieval (#1344)
The ifconfig.co site sometimes returns an HTML page and this info is wrongly sent to my.nethesis.it
New behavior:
- send an HTTP request to ifconfig.co and parse the response, if the remote server returns a valid IP address, return it
- otherwise, try to obtain the same info by executing a DNS query to OpenDNS
- return an empty string if none of the above responses are valid IP addresses1 parent a85f715 commit de9e91d
1 file changed
+18
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
74 | 91 | | |
75 | 92 | | |
76 | 93 | | |
| |||
152 | 169 | | |
153 | 170 | | |
154 | 171 | | |
155 | | - | |
| 172 | + | |
156 | 173 | | |
157 | 174 | | |
158 | 175 | | |
| |||
0 commit comments