~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/http/_urllib2_wrappers.py

  • Committer: Aaron Bentley
  • Date: 2007-02-16 07:02:19 UTC
  • mfrom: (2292 +trunk)
  • mto: (2255.6.1 dirstate)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: aaron.bentley@utoronto.ca-20070216070219-b22k0gwnisnxawnk
Merged bzr.dev (17 tests failing)

Show diffs side-by-side

added added

removed removed

Lines of Context:
708
708
            user_pass, host = host.split('@', 1)
709
709
            if ':' in user_pass:
710
710
                user, password = user_pass.split(':', 1)
711
 
                user_pass = '%s:%s' % (urllib.unquote(user),
712
 
                               urllib.unquote(password))
713
 
                user_pass.encode('base64').strip()
714
 
                req.add_header('Proxy-authorization', 'Basic ' + user_pass)
 
711
            else:
 
712
                user = user_pass
 
713
                password = ''
 
714
            user_pass = '%s:%s' % (urllib.unquote(user),
 
715
                                   urllib.unquote(password))
 
716
            user_pass = user_pass.encode('base64').strip()
 
717
            request.add_header('Proxy-authorization', 'Basic ' + user_pass)
715
718
        host = urllib.unquote(host)
716
719
        request.set_proxy(host, type)
717
720
        if self._debuglevel > 0:
718
 
            print 'set_proxy: proxy set to %r://%r' % (type, host)
 
721
            print 'set_proxy: proxy set to %s://%s' % (type, host)
719
722
        return request
720
723
 
721
724