Child: [875040] (diff)

Download this file

patches.py    20 lines (15 with data), 582 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
import webob
from tg.decorators import Decoration
from allura.lib import helpers as h
def apply():
old_lookup_template_engine = Decoration.lookup_template_engine
@h.monkeypatch(Decoration)
def lookup_template_engine(self, request):
'''Wrapper to handle totally borked-up HTTP-ACCEPT headers'''
try:
return old_lookup_template_engine(self, request)
except:
pass
environ = dict(request.environ, HTTP_ACCEPT='*/*')
request = webob.Request(environ)
return old_lookup_template_engine(self, request)