Bumping k8s dependencies to 1.13

This commit is contained in:
Cheng Xing
2018-11-16 14:08:25 -08:00
parent 305407125c
commit b4c0b68ec7
8002 changed files with 884099 additions and 276228 deletions

View File

@@ -9,13 +9,15 @@ package playground // import "golang.org/x/tools/playground"
import (
"bytes"
"context"
"errors"
"fmt"
"io"
"net/http"
"time"
)
const baseURL = "https://golang.org"
const baseURL = "https://play.golang.org"
func init() {
http.HandleFunc("/compile", bounce)
@@ -25,7 +27,7 @@ func init() {
func bounce(w http.ResponseWriter, r *http.Request) {
b := new(bytes.Buffer)
if err := passThru(b, r); err != nil {
http.Error(w, "Server error.", http.StatusInternalServerError)
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
report(r, err)
return
}
@@ -38,7 +40,9 @@ func passThru(w io.Writer, req *http.Request) error {
}
defer req.Body.Close()
url := baseURL + req.URL.Path
r, err := client(req).Post(url, req.Header.Get("Content-type"), req.Body)
ctx, cancel := context.WithTimeout(contextFunc(req), 60*time.Second)
defer cancel()
r, err := post(ctx, url, req.Header.Get("Content-type"), req.Body)
if err != nil {
return fmt.Errorf("making POST request: %v", err)
}
@@ -49,7 +53,7 @@ func passThru(w io.Writer, req *http.Request) error {
return nil
}
var onAppengine = false // will be overriden by appengine.go and appenginevm.go
var onAppengine = false // will be overridden by appengine.go
func allowShare(r *http.Request) bool {
if !onAppengine {