From ff07078b9cd1f3a48b122ad2fd07afc3fc51a3f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johnny=20Marie=CC=81thoz?= Date: Mon, 5 Dec 2022 14:28:40 +0100 Subject: [PATCH] devel: add keep alive dev server support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since new version of webpack the dev server should support Keep-Alive. This is not enabled by default in werkzeug. Co-Authored-by: Johnny MarieĢthoz --- rero_ils/modules/ext.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rero_ils/modules/ext.py b/rero_ils/modules/ext.py index ffec3f7dd5..8e13e0fe6a 100644 --- a/rero_ils/modules/ext.py +++ b/rero_ils/modules/ext.py @@ -186,6 +186,12 @@ def init_config(self, app): for k in dir(app.config): if k.startswith('RERO_ILS_APP_'): app.config.setdefault(k, getattr(app.config, k)) + # add keep alive support for angular application + # NOTE: this will not work for werkzeug> 2.1.2 + # https://werkzeug.palletsprojects.com/en/2.2.x/changes/#version-2-1-2 + if app.config.get('DEBUG'): + from werkzeug.serving import WSGIRequestHandler + WSGIRequestHandler.protocol_version = "HTTP/1.1" def register_signals(self, app): """Register signals."""