Skip to content

Commit

Permalink
[FIX] invalid character in header value
Browse files Browse the repository at this point in the history
 base64.encodestring adds a trailing new line character to the returned string. This character is not allowed in in the httprequest  header. Use base64.b64encode to avoid trailing new line character in the encoded string
  • Loading branch information
lmignon authored and atchuthan committed May 19, 2016
1 parent 99c7c65 commit 1c258db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion magentoerpconnect/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def _get_binary_image(self, image_data):
request = urllib2.Request(url)
if self.backend_record.auth_basic_username \
and self.backend_record.auth_basic_password:
base64string = base64.encodestring(
base64string = base64.b64encode(
'%s:%s' % (self.backend_record.auth_basic_username,
self.backend_record.auth_basic_password))
request.add_header("Authorization", "Basic %s" % base64string)
Expand Down

0 comments on commit 1c258db

Please sign in to comment.