mirror of
https://github.com/byReqz/probehost2.git
synced 2024-11-14 19:23:14 +00:00
make linter happy
This commit is contained in:
parent
73414736f9
commit
c6ffa0e628
6
main.go
6
main.go
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user