about summary refs log tree commit diff stats
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/server/server.go15
1 files changed, 11 insertions, 4 deletions
diff --git a/internal/server/server.go b/internal/server/server.go
index 3b90038..9038c04 100644
--- a/internal/server/server.go
+++ b/internal/server/server.go
@@ -16,6 +16,8 @@ import (
 	"github.com/getsentry/sentry-go"
 	sentryhttp "github.com/getsentry/sentry-go/http"
 	"github.com/pkg/errors"
+	"golang.org/x/net/http2"
+	"golang.org/x/net/http2/h2c"
 )
 
 var config *cfg.Config
@@ -105,11 +107,16 @@ func New(runtimeConfig *Config) (*Server, error) {
 		&http.Server{
 			Addr:              listenAddress,
 			ReadHeaderTimeout: 1 * time.Minute,
-			Handler: sentryHandler.Handle(
-				serverHeaderHandler(
-					wrapHandlerWithLogging(top),
+			Handler: http.MaxBytesHandler(h2c.NewHandler(
+				sentryHandler.Handle(
+					serverHeaderHandler(
+						wrapHandlerWithLogging(top),
+					),
 				),
-			),
+				&http2.Server{
+					IdleTimeout: 15 * time.Minute,
+				},
+			), 0),
 		},
 	}, nil
 }