[Pkg-mozext-commits] [adblock-plus] 314/464: Fixed: build.py uploadtrans sets wrong Content-Length header

David Prévot taffit at moszumanska.debian.org
Tue Jul 22 20:44:29 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository adblock-plus.

commit ac0985dc48728c061badde9f96db133a6463a612
Author: Wladimir Palant <trev at adblockplus.org>
Date:   Fri Oct 19 12:14:49 2012 +0200

    Fixed: build.py uploadtrans sets wrong Content-Length header
---
 localeTools.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/localeTools.py b/localeTools.py
index 184d212..77ef5bf 100644
--- a/localeTools.py
+++ b/localeTools.py
@@ -300,14 +300,15 @@ def postFiles(files, url):
   boundary = '----------ThIs_Is_tHe_bouNdaRY_$'
   body = ''
   for file, data in files:
-    body +=  '--%s\r\n' % boundary
+    body += '--%s\r\n' % boundary
     body += 'Content-Disposition: form-data; name="files[%s]"; filename="%s"\r\n' % (file, file)
     body += 'Content-Type: application/octet-stream\r\n'
     body += 'Content-Transfer-Encoding: binary\r\n'
     body += '\r\n' + data + '\r\n'
     body += '--%s--\r\n' % boundary
 
-  request = urllib2.Request(url, StringIO(body.encode('utf-8')))
+  body = body.encode('utf-8')
+  request = urllib2.Request(url, StringIO(body))
   request.add_header('Content-Type', 'multipart/form-data; boundary=%s' % boundary)
   request.add_header('Content-Length', len(body))
   result = urllib2.urlopen(request).read()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus.git



More information about the Pkg-mozext-commits mailing list