mirror of
https://github.com/owncast/owncast.git
synced 2024-10-28 10:09:39 +01:00
Set ReadHeaderTimeout in http server
This commit is contained in:
parent
f3a16be0dd
commit
49f977ea45
1 changed files with 4 additions and 2 deletions
|
@ -3,6 +3,7 @@ package router
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
|
@ -386,8 +387,9 @@ func Start() error {
|
||||||
|
|
||||||
h2s := &http2.Server{}
|
h2s := &http2.Server{}
|
||||||
server := &http.Server{
|
server := &http.Server{
|
||||||
Addr: fmt.Sprintf("%s:%d", ip, port),
|
Addr: fmt.Sprintf("%s:%d", ip, port),
|
||||||
Handler: h2c.NewHandler(http.DefaultServeMux, h2s),
|
ReadHeaderTimeout: 4 * time.Second,
|
||||||
|
Handler: h2c.NewHandler(http.DefaultServeMux, h2s),
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Infof("Web server is listening on IP %s port %d.", ip, port)
|
log.Infof("Web server is listening on IP %s port %d.", ip, port)
|
||||||
|
|
Loading…
Reference in a new issue