Do not accept compressed content from unauthenticated request

Closes #13142
(grafted from 1923117e935de62276352585185ced6d854bcb3d)

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier committed 2024-04-17 10:19:58 +02:00
1 parent f0f0d9b7f1
commit 16d36f2390
2 files changed
+6 -2

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
* Do not accept compressed content from unauthenticated request (#13142)
Version 7.0.9 - 2024-04-04
--------------------------
+5 -2
View File
@@ -71,8 +71,11 @@ class Request(_Request):
@property
def decoded_data(self):
if self.content_encoding == 'gzip':
zipfile = gzip.GzipFile(fileobj=BytesIO(self.data), mode='rb')
return zipfile.read()
if self.user_id:
zipfile = gzip.GzipFile(fileobj=BytesIO(self.data), mode='rb')
return zipfile.read()
else:
abort(HTTPStatus.UNSUPPORTED_MEDIA_TYPE)
else:
return self.data