adjustment: modified isConnected check to query linked infisical URL

This commit is contained in:
Sheen Capadngan
2024-04-30 21:00:34 +08:00
parent 104a91647c
commit 877b9a409e
2 changed files with 16 additions and 13 deletions
+4 -2
View File
@@ -4,6 +4,8 @@ import (
"fmt"
"net/http"
"os"
"github.com/Infisical/infisical-merge/packages/config"
)
func GetHomeDir() (string, error) {
@@ -21,7 +23,7 @@ func WriteToFile(fileName string, dataToWrite []byte, filePerm os.FileMode) erro
return nil
}
func CheckIsConnectedToInternet() (ok bool) {
_, err := http.Get("http://clients3.google.com/generate_204")
func CheckIsConnectedToInfisicalAPI() (ok bool) {
_, err := http.Get(fmt.Sprintf("%v/status", config.INFISICAL_URL))
return err == nil
}