Skip to content

Commit f4c3306

Browse files
committed
Add a constant
1 parent e02a2ce commit f4c3306

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

reportportal_client/helpers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
_T = TypeVar('_T')
3131
ATTRIBUTE_LENGTH_LIMIT: int = 128
3232
TRUNCATE_REPLACEMENT: str = '...'
33+
BYTES_TO_READ_FOR_DETECTION = 128
3334

3435

3536
class LifoQueue(Generic[_T]):
@@ -419,8 +420,8 @@ def guess_content_type_from_bytes(data: Union[bytes, bytearray, List[int]]) -> s
419420
if isinstance(data, list):
420421
my_data = bytes(my_data)
421422

422-
if len(my_data) >= 128:
423-
my_data = my_data[:128]
423+
if len(my_data) >= BYTES_TO_READ_FOR_DETECTION:
424+
my_data = my_data[:BYTES_TO_READ_FOR_DETECTION]
424425

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

0 commit comments

Comments
 (0)