Skip to content

Commit 3b71c16

Browse files
committed
fix for unbounded consumption of request wtihout a content-header specified
1 parent b7c0ec6 commit 3b71c16

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

sentry_sdk/integrations/flask.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,12 @@ def _set_request_body_data_on_streaming_segment(
188188
with capture_internal_exceptions():
189189
content_length = int(request.content_length or 0)
190190

191+
# Proceeding without a content length means that we may be consuming the request
192+
# without respecting the bounds specified by the user via `max_request_body_size`
193+
# option in the SDK.
194+
if not content_length:
195+
return
196+
191197
if not request_body_within_bounds(client, content_length):
192198
data = AnnotatedValue.substituted_because_over_size_limit()
193199
else:

0 commit comments

Comments
 (0)