Skip to content

Commit

Permalink
Limit byte data read
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Mar 18, 2024
1 parent 439f8e4 commit a4e121a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions reportportal_client/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,9 @@ def guess_content_type_from_bytes(data: Union[bytes, bytearray, List[int]]) -> s
if isinstance(data, list):
my_data = bytes(my_data)

if len(my_data) >= 128:
my_data = my_data[:128]

if not is_binary(my_data):
return 'text/plain'

Expand Down

0 comments on commit a4e121a

Please sign in to comment.