add more logging to flareresolver request
All checks were successful
Build and publish the docker image / build (push) Successful in 57s
All checks were successful
Build and publish the docker image / build (push) Successful in 57s
Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
parent
c9d498d1f4
commit
a1b89e543c
2
main.go
2
main.go
@ -29,7 +29,7 @@ func main() {
|
|||||||
|
|
||||||
if os.Getenv("DEV") != "true" {
|
if os.Getenv("DEV") != "true" {
|
||||||
gin.SetMode(gin.ReleaseMode)
|
gin.SetMode(gin.ReleaseMode)
|
||||||
fmt.Printf("Running in production mode. Listening on %s:%s.", host, port)
|
fmt.Println("Listening on %s:%s\n", host, port)
|
||||||
}
|
}
|
||||||
|
|
||||||
r := gin.Default()
|
r := gin.Default()
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package utils
|
package utils
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
@ -55,6 +56,11 @@ func GET(target string) ([]byte, int, http.Header, error) {
|
|||||||
return nil, 0, nil, err
|
return nil, 0, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if res.StatusCode() != 200 {
|
||||||
|
fmt.Printf("flareresolver request to %s failed: %d (%s)\n", target, res.StatusCode(), frurl)
|
||||||
|
return nil, 0, nil, fmt.Errorf("flareresolver failure")
|
||||||
|
}
|
||||||
|
|
||||||
response := res.Result().(*response)
|
response := res.Result().(*response)
|
||||||
headers := http.Header{}
|
headers := http.Header{}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user