##// END OF EJS Templates
Bugfix when client is using old mercurial version and not setting http accept
marcink -
r37:707dfdb1 default
parent child Browse files
Show More
@@ -11,6 +11,7 b' from mercurial import ui, hg'
11 11 from mercurial.error import RepoError
12 12 from ConfigParser import ConfigParser
13 13 import encodings
14 from pylons.controllers.util import abort
14 15 log = logging.getLogger(__name__)
15 16
16 17 class HgController(BaseController):
@@ -20,8 +21,13 b' class HgController(BaseController):'
20 21
21 22 def view(self, *args, **kwargs):
22 23 response = g.hgapp(request.environ, self.start_response)
24
25 http_accept = request.environ.get('HTTP_ACCEPT', False)
26 if not http_accept:
27 return abort(status_code=400, detail='no http accept in header')
28
23 29 #for mercurial protocols and raw files we can't wrap into mako
24 if request.environ['HTTP_ACCEPT'].find("mercurial") != -1 or \
30 if http_accept.find("mercurial") != -1 or \
25 31 request.environ['PATH_INFO'].find('raw-file') != -1:
26 32 return response
27 33 try:
General Comments 0
You need to be logged in to leave comments. Login now