~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

(richard-wilbur) Fix lp:1606203 caused by using a user/pass combination for
 http auth longer than ~57 chars. (Vincent Ladeuil) (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
# actual code more or less do that, tests should be written to
49
49
# ensure that.
50
50
 
 
51
import base64
51
52
import errno
52
53
import httplib
53
54
import os
1491
1492
 
1492
1493
    def build_auth_header(self, auth, request):
1493
1494
        raw = '%s:%s' % (auth['user'], auth['password'])
1494
 
        auth_header = 'Basic ' + raw.encode('base64').strip()
 
1495
        auth_header = 'Basic ' + base64.b64encode(raw)
1495
1496
        return auth_header
1496
1497
 
1497
1498
    def extract_realm(self, header_value):