mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-08-18 12:43:56 +00:00
add read header timeout to http servers
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/google/jsonschema-go/jsonschema"
|
||||
"github.com/jwetzell/showbridge-go/internal/common"
|
||||
@@ -163,8 +164,9 @@ func (hs *HTTPServer) Start(ctx context.Context, router common.RouteIO) error {
|
||||
hs.cancel = cancel
|
||||
|
||||
httpServer := &http.Server{
|
||||
Addr: fmt.Sprintf(":%d", hs.Port),
|
||||
Handler: hs,
|
||||
Addr: fmt.Sprintf(":%d", hs.Port),
|
||||
ReadHeaderTimeout: 5 * time.Second,
|
||||
Handler: hs,
|
||||
}
|
||||
|
||||
go func() {
|
||||
|
||||
Reference in New Issue
Block a user