Skip to content

Commit

Permalink
fix(helper): settings localhost IP if icanhazip is unreachable (#78)
Browse files Browse the repository at this point in the history
in cases where you operate on an offline network & you still need to run
checkAndScreen on the intranet, here is the simple fix for u...
  • Loading branch information
djnnvx authored Jul 18, 2023
1 parent a06dda2 commit 2141f5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func GetCurrentIP() string {
req, err := http.NewRequest("GET", "http://icanhazip.com", nil)
if err != nil {
fmt.Printf("[!] Could not query public IP address: %s\n", err.Error())
return ""
return "127.0.0.1" // if the service is offline or not reachable, we should be able to keep going
}

req.Header.Add("User-Agent", ua)
Expand Down

0 comments on commit 2141f5e

Please sign in to comment.