@@ -496,12 +496,16 @@ func Server(newAPI func(*coderd.Options) *coderd.API) *cobra.Command {
496
496
497
497
shutdownConnsCtx , shutdownConns := context .WithCancel (ctx )
498
498
defer shutdownConns ()
499
+
500
+ // ReadHeaderTimeout is purposefully not enabled. It caused some issues with
501
+ // websockets over the dev tunnel.
502
+ // See: https://github.com/coder/coder/pull/3730
503
+ //nolint:gosec
499
504
server := & http.Server {
500
505
// These errors are typically noise like "TLS: EOF". Vault does similar:
501
506
// https://github.com/hashicorp/vault/blob/e2490059d0711635e529a4efcbaa1b26998d6e1c/command/server.go#L2714
502
- ErrorLog : log .New (io .Discard , "" , 0 ),
503
- Handler : coderAPI .Handler ,
504
- ReadHeaderTimeout : time .Minute ,
507
+ ErrorLog : log .New (io .Discard , "" , 0 ),
508
+ Handler : coderAPI .Handler ,
505
509
BaseContext : func (_ net.Listener ) context.Context {
506
510
return shutdownConnsCtx
507
511
},
@@ -1106,10 +1110,13 @@ func configureGithubOAuth2(accessURL *url.URL, clientID, clientSecret string, al
1106
1110
func serveHandler (ctx context.Context , logger slog.Logger , handler http.Handler , addr , name string ) (closeFunc func ()) {
1107
1111
logger .Debug (ctx , "http server listening" , slog .F ("addr" , addr ), slog .F ("name" , name ))
1108
1112
1113
+ // ReadHeaderTimeout is purposefully not enabled. It caused some issues with
1114
+ // websockets over the dev tunnel.
1115
+ // See: https://github.com/coder/coder/pull/3730
1116
+ //nolint:gosec
1109
1117
srv := & http.Server {
1110
- Addr : addr ,
1111
- Handler : handler ,
1112
- ReadHeaderTimeout : time .Minute ,
1118
+ Addr : addr ,
1119
+ Handler : handler ,
1113
1120
}
1114
1121
go func () {
1115
1122
err := srv .ListenAndServe ()
0 commit comments