File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ def validate_content_length_header_not_too_large(
54
54
"""
55
55
given_content_length = request_headers ["Content-Length" ]
56
56
57
- body_length = len (request_body if request_body else b"" )
57
+ body_length = len (request_body )
58
58
given_content_length_value = int (given_content_length )
59
59
# We skip coverage here as running a test to cover this is very slow.
60
60
if given_content_length_value > body_length : # pragma: no cover
@@ -81,7 +81,7 @@ def validate_content_length_header_not_too_small(
81
81
"""
82
82
given_content_length = request_headers ["Content-Length" ]
83
83
84
- body_length = len (request_body if request_body else b"" )
84
+ body_length = len (request_body )
85
85
given_content_length_value = int (given_content_length )
86
86
87
87
if given_content_length_value < body_length :
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ def validate_content_length_header_is_int(
29
29
ContentLengthHeaderNotIntError: The content length header is not an
30
30
integer
31
31
"""
32
- body_length = len (request_body if request_body else b"" )
32
+ body_length = len (request_body )
33
33
given_content_length = request_headers .get ("Content-Length" , body_length )
34
34
35
35
try :
@@ -55,7 +55,7 @@ def validate_content_length_header_not_too_large(
55
55
ContentLengthHeaderTooLargeError: The given content length header says
56
56
that the content length is greater than the body length.
57
57
"""
58
- body_length = len (request_body if request_body else b"" )
58
+ body_length = len (request_body )
59
59
given_content_length = request_headers .get ("Content-Length" , body_length )
60
60
given_content_length_value = int (given_content_length )
61
61
# We skip coverage here as running a test to cover this is very slow.
@@ -80,7 +80,7 @@ def validate_content_length_header_not_too_small(
80
80
AuthenticationFailureError: The given content length header says that
81
81
the content length is smaller than the body length.
82
82
"""
83
- body_length = len (request_body if request_body else b"" )
83
+ body_length = len (request_body )
84
84
given_content_length = request_headers .get ("Content-Length" , body_length )
85
85
given_content_length_value = int (given_content_length )
86
86
You can’t perform that action at this time.
0 commit comments