Skip to content

Commit

Permalink
add ReadHeaderTimeout (#3539)
Browse files Browse the repository at this point in the history
  • Loading branch information
Liuhaai authored and dustinxie committed Sep 1, 2022
1 parent cd423ad commit eb46969
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ func NewHTTPServer(route string, port int, handler http.Handler) *HTTPServer {
}
svr := &HTTPServer{
svr: &http.Server{
Addr: ":" + strconv.Itoa(port),
WriteTimeout: 30 * time.Second,
Addr: ":" + strconv.Itoa(port),
WriteTimeout: 30 * time.Second,
ReadHeaderTimeout: 10 * time.Second,
},
}
mux := http.NewServeMux()
Expand Down

0 comments on commit eb46969

Please sign in to comment.