summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Trowbridge <trowbrds@gmail.com>2010-02-06 11:29:08 -0800
committerDavid Trowbridge <trowbrds@gmail.com>2010-02-06 11:29:08 -0800
commit8a7c87eae5da07831437c54378eab4da6a41a992 (patch)
treeea43a19fe283ef43f39e4ad5a4cc15ab8d769c2b
parentd46241b9517211430fb29b7868146a6e41abe2e0 (diff)
post-review: correctly handle diff uploads, which contains non-ASCII characters
Patch from Thilo-Alexander Ginkel. Previous post-review versions did not correctly generate the Content-Length header sent along with the api/json/reviewrequests/<id>/diff/new/ request as the header's value was calculated based upon the length of the request body in characters instead of bytes. This patch should fix that issue by using the UTF-8 encoding of the body for the length calculation. Reviewed at http://reviews.reviewboard.org/r/1298
-rwxr-xr-xrbtools/postreview.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/rbtools/postreview.py b/rbtools/postreview.py
index 39b29f8..eeb96ef 100755
--- a/rbtools/postreview.py
+++ b/rbtools/postreview.py
@@ -653,7 +653,7 @@ class ReviewBoardServer(object):
content_type = "multipart/form-data; boundary=%s" % BOUNDARY
- return content_type, content
+ return content_type, content.encode('utf-8')
class SCMClient(object):