mercurial/url.py
changeset 30763 a520aefb96f1
parent 30664 69acfd2ca11e
child 30820 6a70cf94d1b5
equal deleted inserted replaced
30762:35b516f800e0 30763:a520aefb96f1
   464     # own distribution name. Since servers should not be using the user
   464     # own distribution name. Since servers should not be using the user
   465     # agent string for anything, clients should be able to define whatever
   465     # agent string for anything, clients should be able to define whatever
   466     # user agent they deem appropriate.
   466     # user agent they deem appropriate.
   467     agent = 'mercurial/proto-1.0 (Mercurial %s)' % util.version()
   467     agent = 'mercurial/proto-1.0 (Mercurial %s)' % util.version()
   468     opener.addheaders = [('User-agent', agent)]
   468     opener.addheaders = [('User-agent', agent)]
       
   469 
       
   470     # This header should only be needed by wire protocol requests. But it has
       
   471     # been sent on all requests since forever. We keep sending it for backwards
       
   472     # compatibility reasons. Modern versions of the wire protocol use
       
   473     # X-HgProto-<N> for advertising client support.
   469     opener.addheaders.append(('Accept', 'application/mercurial-0.1'))
   474     opener.addheaders.append(('Accept', 'application/mercurial-0.1'))
   470     return opener
   475     return opener
   471 
   476 
   472 def open(ui, url_, data=None):
   477 def open(ui, url_, data=None):
   473     u = util.url(url_)
   478     u = util.url(url_)