mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-18 07:56:56 +00:00
fix: avoid panic by handling getOutboundIP() error
This commit is contained in:
parent
05c79b7119
commit
56c9ea5430
@ -61,6 +61,10 @@ func getOutboundIP() string {
|
|||||||
ip := []byte("NA")
|
ip := []byte("NA")
|
||||||
resp, err := http.Get("https://api.ipify.org?format=text")
|
resp, err := http.Get("https://api.ipify.org?format=text")
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
ipBody, err := ioutil.ReadAll(resp.Body)
|
ipBody, err := ioutil.ReadAll(resp.Body)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user