Skip to content

Commit ce608a5

Browse files
committed
fix: handle passing StringIO as file
1 parent 1a54aca commit ce608a5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

interactions/client/utils/serializer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ def get_file_mimetype(file_data: bytes) -> str:
170170
The mimetype of the file.
171171
172172
"""
173+
if isinstance(file_data, str):
174+
return "text/plain"
175+
173176
if file_data.startswith(b"{"):
174177
return "application/json"
175178
elif file_data.startswith((b"GIF87a", b"GIF89a")):

0 commit comments

Comments
 (0)