internal/play: impose time limit on compile proxy

Every day around 3:30pm US Eastern time
the web server seems to get overloaded.
It starts with a suspicious number of 500 responses
from /_/compile relaying to the default back end,
which start timing out after 10 seconds and then
grow longer and longer.

One theory is that the requests are lasting longer
than that and piling up in the system, since we are
using http.DefaultClient, which has no timeout.
Use a client with a 20s timeout to try to clear things
out a bit more promptly.

Change-Id: I7e1659adfcf63d6b712ede4d0fc2b508b3e6bb45
Reviewed-on: https://go-review.googlesource.com/c/website/+/375614
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Jamal Carvalho <jamalcarvalho@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
diff --git a/internal/play/proxy.go b/internal/play/proxy.go
index 443b899..60047ec 100644
--- a/internal/play/proxy.go
+++ b/internal/play/proxy.go
@@ -104,7 +104,10 @@
 	hReq.Header.Set("Content-Type", "application/json")
 	hReq = hReq.WithContext(ctx)
 
-	r, err := http.DefaultClient.Do(hReq)
+	client := &http.Client{
+		Timeout: 20 * time.Second,
+	}
+	r, err := client.Do(hReq)
 	if err != nil {
 		return fmt.Errorf("making request: %v", err)
 	}