Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ec3dfde

Browse files
committed
Only write out one blank line before the request data.
This closes SF patch #419459.
1 parent d153a98 commit ec3dfde

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/urllib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def open_http(self, url, data=None):
286286
for args in self.addheaders: apply(h.putheader, args)
287287
h.endheaders()
288288
if data is not None:
289-
h.send(data + '\r\n')
289+
h.send(data)
290290
errcode, errmsg, headers = h.getreply()
291291
fp = h.getfile()
292292
if errcode == 200:
@@ -364,7 +364,7 @@ def open_https(self, url, data=None):
364364
for args in self.addheaders: apply(h.putheader, args)
365365
h.endheaders()
366366
if data is not None:
367-
h.send(data + '\r\n')
367+
h.send(data)
368368
errcode, errmsg, headers = h.getreply()
369369
fp = h.getfile()
370370
if errcode == 200:

Lib/urllib2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ def do_open(self, http_class, req):
809809
h.putheader(k, v)
810810
h.endheaders()
811811
if req.has_data():
812-
h.send(data + '\r\n')
812+
h.send(data)
813813

814814
code, msg, hdrs = h.getreply()
815815
fp = h.getfile()

0 commit comments

Comments
 (0)