~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_http.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:
260
260
        self.assertEqual('basic', scheme)
261
261
        self.assertEqual('realm="Thou should not pass"', remainder)
262
262
 
 
263
    def test_build_basic_header_with_long_creds(self):
 
264
        handler = _urllib2_wrappers.BasicAuthHandler()
 
265
        user = 'user' * 10  # length 40
 
266
        password = 'password' * 5  # length 40
 
267
        header = handler.build_auth_header(
 
268
            dict(user=user, password=password), None)
 
269
        # https://bugs.launchpad.net/bzr/+bug/1606203 was caused by incorrectly
 
270
        # creating a header value with an embedded '\n'
 
271
        self.assertFalse('\n' in header)
 
272
 
263
273
    def test_basic_extract_realm(self):
264
274
        scheme, remainder = self.parse_header(
265
275
            'Basic realm="Thou should not pass"',