Skip to content

Commit

Permalink
BatchHTTPRequest: only add access token header if we have it
Browse files Browse the repository at this point in the history
re-fixes googleapis#350. it was originally fixed by c669a3b following discussion in googleapis#351 (comment) , but then that fix got lost in the next commit, googleapis@282fc88 .
  • Loading branch information
snarfed committed Aug 29, 2017
1 parent b63a71d commit d94cb5b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion googleapiclient/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,8 @@ def _serialize_request(self, request):
if request.http is not None:
credentials = _auth.get_credentials_from_http(request.http)
if credentials is not None:
_auth.apply_credentials(credentials, headers)
if _auth.has_access_token(credentials):
_auth.apply_credentials(credentials, headers)

# MIMENonMultipart adds its own Content-Type header.
if 'content-type' in headers:
Expand Down

0 comments on commit d94cb5b

Please sign in to comment.