Skip to content

Commit

Permalink
fix: add ReadHeaderTimeout [G112]
Browse files Browse the repository at this point in the history
  • Loading branch information
niklastreml committed Nov 17, 2022
1 parent 4db4680 commit 6d5c988
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
"mime"
"net/http"
"strconv"
"time"

connect "github.com/bufbuild/connect-go"
grpc_zap "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap"
Expand Down Expand Up @@ -133,8 +134,9 @@ func StartApi(data data.Database, config *Configuration, log *zap.SugaredLogger)
mux.Handle(apiv1connect.NewApiServiceHandler(a, interceptors))
mux.Handle("/api/v1/", gwmux)
server := &http.Server{
Addr: addr,
Handler: h2c.NewHandler(mux, &http2.Server{}),
Addr: addr,
Handler: h2c.NewHandler(mux, &http2.Server{}),
ReadHeaderTimeout: time.Minute,
}
log.Info("Serving Connect, gRPC-Gateway and OpenAPI Documentation on ", addr)

Expand Down

0 comments on commit 6d5c988

Please sign in to comment.