make linter happy

This commit is contained in:
Nils 2022-12-29 23:04:13 +01:00
parent 73414736f9
commit c6ffa0e628
Signed by: byreqz
GPG Key ID: 396A62D7D436749E

View File

@ -27,7 +27,7 @@ func init() {
logstdout.SetLevel(log.InfoLevel) logstdout.SetLevel(log.InfoLevel)
var logfilepath string var logfilepath string
if _, exists := os.LookupEnv("PROBEHOST_LOGPATH"); exists == true { if _, exists := os.LookupEnv("PROBEHOST_LOGPATH"); exists {
logfilepath, _ = os.LookupEnv("PROBEHOST_LOGPATH") logfilepath, _ = os.LookupEnv("PROBEHOST_LOGPATH")
} else { } else {
logfilepath = "probehost2.log" logfilepath = "probehost2.log"
@ -37,7 +37,7 @@ func init() {
} else { } else {
allowprivate = false allowprivate = false
} }
if envvalue, exists := os.LookupEnv("PROBEHOST_LISTEN_PORT"); exists == true { if envvalue, exists := os.LookupEnv("PROBEHOST_LISTEN_PORT"); exists {
var err error var err error
listenport, err = strconv.Atoi(envvalue) listenport, err = strconv.Atoi(envvalue)
if err != nil { if err != nil {
@ -147,7 +147,7 @@ func prerunner(req *http.Request, cmd string, cmdopts map[string]string, default
var res string var res string
var args []string var args []string
var remoteaddr string var remoteaddr string
if req.Header.Get("X-Forwarded-For") != "" && disablexforwardedfor != true { if req.Header.Get("X-Forwarded-For") != "" && !disablexforwardedfor {
remoteaddr = req.Header.Get("X-Forwarded-For") remoteaddr = req.Header.Get("X-Forwarded-For")
} else { } else {
remoteaddr = req.RemoteAddr remoteaddr = req.RemoteAddr