Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (2)
Set Content-Length for BinaryResult
· 0f7c3d07
Julien Cristau
authored
Jul 06, 2018
0f7c3d07
Merge branch 'jcristau/security-tracker-content-length'
· 78b980b5
Salvatore Bonaccorso
authored
Jul 06, 2018
78b980b5
Hide whitespace changes
Inline
Side-by-side
lib/python/web_support.py
View file @
78b980b5
...
...
@@ -674,6 +674,7 @@ class BinaryResult(Result):
self
.
contents
=
contents
self
.
status
=
status
self
.
headers
[
'
Content-Type
'
]
=
mimetype
self
.
headers
[
'
Content-Length
'
]
=
str
(
len
(
self
.
contents
))
def
flatten
(
self
,
write
):
"""
Invokes write for the response header and the binary data.
"""
...
...