projects
/
services
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ae55676
)
If Content-Length is already set, don't override
author
Ian Cordasco
<graffatcolmingov@gmail.com>
Fri, 1 Feb 2013 16:55:02 +0000
(11:55 -0500)
committer
Ian Cordasco
<graffatcolmingov@gmail.com>
Fri, 1 Feb 2013 16:58:23 +0000
(11:58 -0500)
Re: #1159
requests/models.py
patch
|
blob
|
history
diff --git
a/requests/models.py
b/requests/models.py
index
9198c4c
..
a845b44
100644
(file)
--- a/
requests/models.py
+++ b/
requests/models.py
@@
-387,6
+387,8
@@
class PreparedRequest(RequestEncodingMixin, RequestHooksMixin):
self.body = body
def prepare_content_length(self, body):
+ if self.headers.get('Content-Length'):
+ return
if hasattr(body, 'seek') and hasattr(body, 'tell'):
body.seek(0, 2)
self.headers['Content-Length'] = str(body.tell())