Skip to content
Myr

Merge pull request #1161 from sigmavirus24/fix1159

Before adoption: this commit came in with the history the project adopted, so no landing records it.

If Content-Length is already set, don't override

authored by Kenneth Reitz · committed by Kenneth Reitz · parents 90cd37f, 544d08d · Browse files · 1 file+2 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−0 removed

  • other:+2 added−0 removed

1 file+2 added−0 removed

modified:requests/models.py+2 added
385 unmodified lines
386387 self.body = body388389 def prepare_content_length(self, body):390 if self.headers.get('Content-Length'):391 return392 if hasattr(body, 'seek') and hasattr(body, 'tell'):393 body.seek(0, 2)394 self.headers['Content-Length'] = str(body.tell())395 body.seek(0, 0)
273 unmodified lines