From 0bde1b62e19ee4fb270871a3c9886f114030a90c Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Mon, 10 Oct 2016 14:22:18 -0700 Subject: [PATCH] Timeout reads and writes in the http server. --- prog/app.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/prog/app.go b/prog/app.go index a830c3525..6e9cb212a 100644 --- a/prog/app.go +++ b/prog/app.go @@ -276,8 +276,11 @@ func appMain(flags appFlags) { // we want to manage the stop condition ourselves below NoSignalHandling: true, Server: &http.Server{ - Addr: flags.listen, - Handler: handler, + Addr: flags.listen, + Handler: handler, + ReadTimeout: 10 * time.Second, + WriteTimeout: 10 * time.Second, + MaxHeaderBytes: 1 << 20, }, } go func() {