##// 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 from mercurial.error import RepoError
11 from mercurial.error import RepoError
12 from ConfigParser import ConfigParser
12 from ConfigParser import ConfigParser
13 import encodings
13 import encodings
14 from pylons.controllers.util import abort
14 log = logging.getLogger(__name__)
15 log = logging.getLogger(__name__)
15
16
16 class HgController(BaseController):
17 class HgController(BaseController):
@@ -20,8 +21,13 b' class HgController(BaseController):'
20
21
21 def view(self, *args, **kwargs):
22 def view(self, *args, **kwargs):
22 response = g.hgapp(request.environ, self.start_response)
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 #for mercurial protocols and raw files we can't wrap into mako
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 request.environ['PATH_INFO'].find('raw-file') != -1:
31 request.environ['PATH_INFO'].find('raw-file') != -1:
26 return response
32 return response
27 try:
33 try:
General Comments 0
You need to be logged in to leave comments. Login now