File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 1
1
from __future__ import print_function
2
2
3
+
3
4
import os
4
5
import sys
5
6
import collections
20
21
import flask
21
22
from flask_compress import Compress
22
23
from werkzeug .debug .tbtools import get_current_traceback
24
+ from pkg_resources import get_distribution , parse_version
23
25
24
26
import plotly
25
27
import dash_renderer
49
51
from . import _validate
50
52
from . import _watch
51
53
54
+ flask_compress_version = parse_version (get_distribution ("flask-compress" ).version )
55
+
52
56
# Add explicit mapping for map files
53
57
mimetypes .add_type ("application/json" , ".map" , True )
54
58
@@ -280,7 +284,9 @@ def __init__(
280
284
elif isinstance (server , bool ):
281
285
name = name if name else "__main__"
282
286
self .server = flask .Flask (name ) if server else None
283
- if self .server is not None :
287
+ if self .server is not None and flask_compress_version >= parse_version (
288
+ "1.6.0"
289
+ ):
284
290
# flask-compress==1.6.0 changed default to ['br', 'gzip']
285
291
# and non-overridable default compression with Brotli is
286
292
# causing performance issues
You can’t perform that action at this time.
0 commit comments