Skip to content

Commit a4e121a

Browse files
committed
Limit byte data read
1 parent 439f8e4 commit a4e121a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

reportportal_client/helpers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,9 @@ def guess_content_type_from_bytes(data: Union[bytes, bytearray, List[int]]) -> s
419419
if isinstance(data, list):
420420
my_data = bytes(my_data)
421421

422+
if len(my_data) >= 128:
423+
my_data = my_data[:128]
424+
422425
if not is_binary(my_data):
423426
return 'text/plain'
424427

0 commit comments

Comments
 (0)