Copy request body in ProxyServer (kubecfg -proxy)

Fixes #1149 - kubecfg proxy "411 Length Required" error on POST/PUT.
Passing r.Body directly doesn't work: http.Client won't deliver r.Body's
data with the proxy request on proxyreq.Do().

This is the only way I found which fixes the original bug.
On 20 Oct 2014 19:51, "Daniel Smith" <notifications@github.com> wrote:

> In pkg/kubecfg/proxy_server.go:
>
> >  		Verb(r.Method).
> >  		AbsPath(r.URL.Path).
> >  		ParseSelectorParam("labels", selector).
> > -		ParseSelectorParam("fields", fieldSelector).
> > -		Body(r.Body).
> > -		Do()
> > +		ParseSelectorParam("fields", fieldSelector)
> > +
> > +	if r.Method == "POST" || r.Method == "PUT" {
> > +		body, err := ioutil.ReadAll(r.Body)
>
> r.Body is an io.Reader and proxyreq.Body() takes an io.Reader-- why do
> this readall?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/GoogleCloudPlatform/kubernetes/pull/1893/files#r19105018>
> .
>