~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/http.py

[merge] James Henstridge: Set user agent for http

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
import urlparse
23
23
from warnings import warn
24
24
 
 
25
import bzrlib
25
26
from bzrlib.transport import Transport, Server
26
27
from bzrlib.errors import (TransportNotPossible, NoSuchFile, 
27
28
                           TransportError, ConnectionError)
68
69
    url = extract_auth(url, manager)
69
70
    auth_handler = urllib2.HTTPBasicAuthHandler(manager)
70
71
    opener = urllib2.build_opener(auth_handler)
71
 
    url_f = opener.open(url)
72
 
    return url_f
 
72
 
 
73
    request = urllib2.Request(url)
 
74
    request.add_header('User-Agent', 'bzr/%s' % bzrlib.__version__)
 
75
    response = opener.open(request)
 
76
    return response
73
77
 
74
78
class HttpTransport(Transport):
75
79
    """This is the transport agent for http:// access.