Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-Flask-Compress for
openSUSE:Factory checked in at 2022-06-05 21:28:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-Flask-Compress (Old)
and /work/SRC/openSUSE:Factory/.python-Flask-Compress.new.1548 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-Flask-Compress"
Sun Jun 5 21:28:27 2022 rev:9 rq:980839 version:1.12
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-Flask-Compress/python-Flask-Compress.changes
2022-03-06 18:15:53.431826937 +0100
+++
/work/SRC/openSUSE:Factory/.python-Flask-Compress.new.1548/python-Flask-Compress.changes
2022-06-05 21:28:32.733047589 +0200
@@ -1,0 +2,9 @@
+Sun Jun 5 04:37:02 UTC 2022 - Arun Persaud <[email protected]>
+
+- specfile:
+ * update copyright year
+
+- update to version 1.12:
+ * Disable compression when response is streamed, see #31
+
+-------------------------------------------------------------------
Old:
----
Flask-Compress-1.11.tar.gz
New:
----
Flask-Compress-1.12.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-Flask-Compress.spec ++++++
--- /var/tmp/diff_new_pack.RvG4k3/_old 2022-06-05 21:28:33.197048213 +0200
+++ /var/tmp/diff_new_pack.RvG4k3/_new 2022-06-05 21:28:33.209048229 +0200
@@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-Flask-Compress
-Version: 1.11
+Version: 1.12
Release: 0
Summary: Compress responses in Flask apps with gzip
License: MIT
++++++ Flask-Compress-1.11.tar.gz -> Flask-Compress-1.12.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Flask-Compress-1.11/CHANGELOG.md
new/Flask-Compress-1.12/CHANGELOG.md
--- old/Flask-Compress-1.11/CHANGELOG.md 2022-03-01 10:48:46.000000000
+0100
+++ new/Flask-Compress-1.12/CHANGELOG.md 2022-04-28 14:26:34.000000000
+0200
@@ -2,6 +2,10 @@
All notable changes to `flask-compress` will be documented in this file.
+## 1.12 (2022-04-28)
+
+- Disable compression when response is streamed, see
[#31](https://github.com/colour-science/flask-compress/pull/31)
+
## 1.11 (2022-03-01)
- When compression is enabled, *accept-encoding* is always added to the `Vary`
header, fixes [#28](https://github.com/colour-science/flask-compress/issues/28)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Flask-Compress-1.11/Flask_Compress.egg-info/PKG-INFO
new/Flask-Compress-1.12/Flask_Compress.egg-info/PKG-INFO
--- old/Flask-Compress-1.11/Flask_Compress.egg-info/PKG-INFO 2022-03-01
10:49:02.000000000 +0100
+++ new/Flask-Compress-1.12/Flask_Compress.egg-info/PKG-INFO 2022-04-28
14:26:47.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: Flask-Compress
-Version: 1.11
+Version: 1.12
Summary: Compress responses in your Flask app with gzip, deflate or brotli.
Home-page: https://github.com/colour-science/flask-compress
Author: Thomas Mansencal
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Flask-Compress-1.11/PKG-INFO
new/Flask-Compress-1.12/PKG-INFO
--- old/Flask-Compress-1.11/PKG-INFO 2022-03-01 10:49:02.689063300 +0100
+++ new/Flask-Compress-1.12/PKG-INFO 2022-04-28 14:26:47.721182600 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: Flask-Compress
-Version: 1.11
+Version: 1.12
Summary: Compress responses in your Flask app with gzip, deflate or brotli.
Home-page: https://github.com/colour-science/flask-compress
Author: Thomas Mansencal
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Flask-Compress-1.11/flask_compress/_version.py
new/Flask-Compress-1.12/flask_compress/_version.py
--- old/Flask-Compress-1.11/flask_compress/_version.py 2022-03-01
10:49:01.000000000 +0100
+++ new/Flask-Compress-1.12/flask_compress/_version.py 2022-04-28
14:26:46.000000000 +0200
@@ -1 +1 @@
-__version__ = "1.11"
+__version__ = "1.12"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Flask-Compress-1.11/flask_compress/flask_compress.py
new/Flask-Compress-1.12/flask_compress/flask_compress.py
--- old/Flask-Compress-1.11/flask_compress/flask_compress.py 2022-03-01
10:48:46.000000000 +0100
+++ new/Flask-Compress-1.12/flask_compress/flask_compress.py 2022-04-28
14:26:34.000000000 +0200
@@ -178,6 +178,7 @@
response.mimetype not in app.config["COMPRESS_MIMETYPES"] or
response.status_code < 200 or
response.status_code >= 300 or
+ response.is_streamed or
"Content-Encoding" in response.headers or
(response.content_length is not None and
response.content_length < app.config["COMPRESS_MIN_SIZE"])):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Flask-Compress-1.11/tests/test_flask_compress.py
new/Flask-Compress-1.12/tests/test_flask_compress.py
--- old/Flask-Compress-1.11/tests/test_flask_compress.py 2022-03-01
10:48:46.000000000 +0100
+++ new/Flask-Compress-1.12/tests/test_flask_compress.py 2022-04-28
14:26:34.000000000 +0200
@@ -349,5 +349,35 @@
self.assertEqual(response.headers.get('Content-Encoding'), 'deflate')
+class StreamTests(unittest.TestCase):
+ def setUp(self):
+ self.app = Flask(__name__)
+ self.app.testing = True
+
+ self.file_path = os.path.join(os.getcwd(), 'tests', 'templates',
+ 'large.html')
+ self.file_size = os.path.getsize(self.file_path)
+
+ Compress(self.app)
+
+ @self.app.route('/stream/large')
+ def stream():
+ def _stream():
+ with open(self.file_path) as f:
+ for line in f.readlines():
+ yield line
+ return self.app.response_class(_stream(), mimetype='text/html')
+
+ def test_no_compression_stream(self):
+ """ Tests compression is skipped when response is streamed"""
+ client = self.app.test_client()
+ for algorithm in ('gzip', 'deflate', 'br', ''):
+ headers = [('Accept-Encoding', algorithm)]
+ response = client.get('/stream/large', headers=headers)
+ self.assertEqual(response.status_code, 200)
+ self.assertEqual(response.is_streamed, True)
+ self.assertEqual(self.file_size, len(response.data))
+
+
if __name__ == '__main__':
unittest.main()