Skip to content

Commit

Permalink
fix: update content-length header for next page
Browse files Browse the repository at this point in the history
The content-length header only gets updated at request object
initialization, so make sure we update it here after we modified the
body.

Fixes googleapis#1403
  • Loading branch information
schweikert committed Jun 7, 2021
1 parent 4d1153d commit 1e2117d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions googleapiclient/discovery.py
Expand Up @@ -1283,6 +1283,9 @@ def methodNext(self, previous_request, previous_response):
body = model.deserialize(request.body)
body[pageTokenName] = nextPageToken
request.body = model.serialize(body)
request.body_size = len(request.body)
if "content-length" in request.headers:
del request.headers['content-length']
logger.debug("Next page request body: %s %s" % (methodName, body))

return request
Expand Down

0 comments on commit 1e2117d

Please sign in to comment.