The problem is that opts.multipart[].body is removed after the first
attempt.

Attempting to replay the request gives an error about no body being
provided in the multipart.

I am assuming that request is destroying them as it uses them, although I
don't know why it would do that and couldn't track down where. My patch is,
admittedly, a bit of a kludge since I couldn't find the underlying problem
and instead hacked around the symptom.


On Tue, Nov 5, 2013 at 5:52 AM, rakyll <notifications@github.com> wrote:

> In lib/auth/oauth2client.js:
>
> > @@ -203,6 +211,12 @@ OAuth2Client.prototype.request =
> >            var tokens = result;
> >            tokens.refresh_token = credentials.refresh_token;
> >            that.credentials = tokens;
> > +
> > +          // Refresh the bodies
> > +          bodies.forEach( function(body,i){
> > +            opts.multipart[i].body = body;
> > +          });
> > +
> >            that.request(opts, opt_callback, true);
>
> What's wrong with replaying with the existing opts here?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/google/google-api-nodejs-client/pull/98/files#r7426880>
> .
>