Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go.talks
LGTM On Wed, Jul 17, 2013 at 3:07 PM, <adg@golang.org> wrote: > Reviewers: golang-dev1, > > Message: > Hello golang-dev@googlegroups.com, > > I'd like you to review this change to > https://code.google.com/p/go.**talks <https://code.google.com/p/go.talks> > > > Description: > go.talks/pkg/playground: proxy share handler too > > Please review this at https://codereview.appspot.**com/11415043/<https://codereview.appspot.com/114... > > Affected files: > M pkg/playground/common.go > > > Index: pkg/playground/common.go > ==============================**==============================**======= > --- a/pkg/playground/common.go > +++ b/pkg/playground/common.go > @@ -13,16 +13,17 @@ > "net/http" > ) > > -const runURL = "http://golang.org/compile" > +const baseURL = "http://golang.org" > > func init() { > - http.HandleFunc("/compile", compile) > + http.HandleFunc("/compile", bounce) > + http.HandleFunc("/share", bounce) > } > > -func compile(w http.ResponseWriter, r *http.Request) { > +func bounce(w http.ResponseWriter, r *http.Request) { > b := new(bytes.Buffer) > if err := passThru(b, r); err != nil { > - http.Error(w, "Compile server error.", http.** > StatusInternalServerError) > + http.Error(w, "Server error.", http.** > StatusInternalServerError) > report(r, err) > return > } > @@ -31,7 +32,8 @@ > > func passThru(w io.Writer, req *http.Request) error { > defer req.Body.Close() > - r, err := client(req).Post(runURL, req.Header.Get("Content-type")* > *, req.Body) > + url := baseURL + req.URL.Path > + r, err := client(req).Post(url, req.Header.Get("Content-type")**, > req.Body) > if err != nil { > return fmt.Errorf("making POST request: %v", err) > } > > > -- > > ---You received this message because you are subscribed to the Google > Groups "golang-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-dev+unsubscribe@**googlegroups.com<golang-dev%2Bunsubscribe@googlegrou... > . > For more options, visit https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/o... > . > > >
*** Submitted as https://code.google.com/p/go/source/detail?r=afcde7da5687&repo=talks *** go.talks/pkg/playground: proxy share handler too R=golang-dev, bradfitz CC=golang-dev https://codereview.appspot.com/11415043