diff --git a/addons/web/common/http.py b/addons/web/common/http.py index 6dc99f2c997..2d3452556a8 100644 --- a/addons/web/common/http.py +++ b/addons/web/common/http.py @@ -420,7 +420,7 @@ def session_context(request, storage_path, session_cookie='httpsessionid'): #---------------------------------------------------------- # OpenERP Web WSGI Application #---------------------------------------------------------- -class DisableCacheMiddleware(object): +class CustomStaticMiddleware(object): def __init__(self, app): self.app = app def __call__(self, environ, start_response): @@ -431,8 +431,11 @@ class DisableCacheMiddleware(object): new_headers = [] unwanted_keys = ['Last-Modified'] + if environ.get('PATH_INFO', '').endswith(".ttf"): + new_headers.append(("Content-Type", "application/x-font-ttf")) + unwanted_keys += ["Content-Type"] if debug: - new_headers = [('Cache-Control', 'no-cache')] + new_headers.append(('Cache-Control', 'no-cache')) unwanted_keys += ['Expires', 'Etag', 'Cache-Control'] for k, v in headers: @@ -477,7 +480,7 @@ class Root(object): static_dirs = self._load_addons() if options.serve_static: app = werkzeug.wsgi.SharedDataMiddleware( self.dispatch, static_dirs) - self.dispatch = DisableCacheMiddleware(app) + self.dispatch = CustomStaticMiddleware(app) if options.session_storage: if not os.path.exists(options.session_storage):