fix timeing
This commit is contained in:
@@ -76,7 +76,7 @@ func NewServer(documentRoot string, srv *data.Service, creds map[string]string,
|
|||||||
s.Server = &http.Server{
|
s.Server = &http.Server{
|
||||||
Addr: fmt.Sprintf(":%d", port),
|
Addr: fmt.Sprintf(":%d", port),
|
||||||
Handler: router,
|
Handler: router,
|
||||||
ReadHeaderTimeout: 2,
|
ReadHeaderTimeout: 2 * time.Second,
|
||||||
}
|
}
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"slices"
|
"slices"
|
||||||
"sync"
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/go-chi/chi/v5/middleware"
|
"github.com/go-chi/chi/v5/middleware"
|
||||||
@@ -107,7 +108,7 @@ func NewServer(c config.Configuration) *HTTPServer {
|
|||||||
s.Server = &http.Server{
|
s.Server = &http.Server{
|
||||||
Addr: fmt.Sprintf(":%d", c.Server.Port),
|
Addr: fmt.Sprintf(":%d", c.Server.Port),
|
||||||
Handler: router,
|
Handler: router,
|
||||||
ReadHeaderTimeout: 2,
|
ReadHeaderTimeout: 2 * time.Second,
|
||||||
}
|
}
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user