1. Peter Sanchez
  2. zerigodns

Commits

Peter Sanchez  committed 0603769

Switched to use base64.b64encode to avoid newlines. Ticket #1

  • Participants
  • Parent commits c5fa8cb
  • Branches default

Comments (0)

Files changed (1)

File zerigodns/api.py

View file
  • Ignore whitespace
         self.key = key
     
     def get_auth_header(self):
-        base64str = base64.encodestring('%s:%s' % (self.user, self.key))
+        base64str = base64.b64encode('%s:%s' % (self.user, self.key))
         return {
             'Authorization': 'Basic %s' % base64str,
             'Accept': 'application/xml',
         xml = self.send_request(method='GET', id=self.id)
         data = self.parse(xml)
         self.load(data['host-template'])
-        return self
+        return self