Harden http.Serve() with sensible Timeouts
- Dominant language
- Go
- Stars
- 17.1k
- Forks
- 3.2k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 11
Description
#### Version information: master
#### Type: Enhancement
#### Priority: P4
#### Description:
Currently we do:
https://github.com/ipfs/go-ipfs/blob/67a1b3e1bfe9d05478f15068f31cc6868f12a74f/core/corehttp/corehttp.go#L83
But https://blog.gopheracademy.com/advent-2016/exposing-go-on-the-internet/ shows that it is better to initialize a Server object and set sensible timeouts:

Example:
```
srv := &http.Server{
ReadTimeout: 5 * time.Second,
WriteTimeout: 10 * time.Second,
IdleTimeout: 120 * time.Second,
Handler: serveMux,
}
```
(IdleTimeout is only in Go 1.8)
Contributor guide
Assessment
This issue has not been assessed yet.