From 5be1e292fc49b2abcc1287ad1e263bd904cce1dc Mon Sep 17 00:00:00 2001 From: "Dr. Peter Poeml" Date: Wed, 19 Jul 2006 15:15:57 +0000 Subject: [PATCH] fix issue with uploading files -- in PUT requests, there was an additional newline inserted, which could lead to wrong interpretation of the payload if e.g. an intercepting web proxy was in between osc and the api server --- osc/othermethods.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osc/othermethods.py b/osc/othermethods.py index 91c0e368..2e670c32 100755 --- a/osc/othermethods.py +++ b/osc/othermethods.py @@ -21,7 +21,7 @@ BLOCKSIZE=1024 def delfile(url, file, username, password): - auth_string = base64.encodestring('%s:%s' % (username, password)) + auth_string = base64.encodestring('%s:%s' % (username, password)).strip() u = urlparse.urlparse(url) host = u[1] @@ -47,7 +47,7 @@ def putfile(url, file, username, password): size = os.stat(file)[6] - auth_string = base64.encodestring('%s:%s' % (username, password)) + auth_string = base64.encodestring('%s:%s' % (username, password)).strip() u = urlparse.urlparse(url) host = u[1]