Update Github Actions Go Version (#12391)

* update github actions

* use quotes or it is go 1.2 

lol

* Update gosec

* Update gosec

* Update go lint

* fix gosec violations

---------

Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
This commit is contained in:
Raul Jordan
2023-05-12 23:51:20 +08:00
committed by GitHub
parent 2c3b3b802a
commit e5c9387cd9
5 changed files with 30 additions and 11 deletions

View File

@@ -114,7 +114,13 @@ func main() {
mux := http.NewServeMux()
mux.HandleFunc("/p2p", handler.httpHandler)
if err := http.ListenAndServe(fmt.Sprintf(":%d", *metricsPort), mux); err != nil {
srv := &http.Server{
Addr: fmt.Sprintf(":%d", *metricsPort),
ReadHeaderTimeout: 3 * time.Second,
Handler: mux,
}
if err := srv.ListenAndServe(); err != nil {
log.WithError(err).Fatal("Failed to start server")
}

View File

@@ -76,7 +76,11 @@ func main() {
http.HandleFunc("/metrics", MetricsHTTP)
http.HandleFunc("/reload", ReloadHTTP)
log.Fatal(http.ListenAndServe(fmt.Sprintf("127.0.0.1:%d", *port), nil))
srv := &http.Server{
Addr: fmt.Sprintf("127.0.0.1:%d", *port),
ReadHeaderTimeout: 3 * time.Second,
}
log.Fatal(srv.ListenAndServe())
}
// Watching address wrapper

View File

@@ -13,6 +13,7 @@ import (
"os"
"path/filepath"
"strconv"
"time"
"github.com/prysmaticlabs/prysm/v4/config/params"
)
@@ -51,7 +52,11 @@ func main() {
}
})
log.Printf("Listening on port %d", *port)
log.Fatal(http.ListenAndServe(":"+strconv.Itoa(*port), nil))
srv := &http.Server{
Addr: ":" + strconv.Itoa(*port),
ReadHeaderTimeout: 3 * time.Second,
}
log.Fatal(srv.ListenAndServe())
}
func captureRequest(f *os.File, m map[string]interface{}) error {