Skip to content

Commit

Permalink
quick nit
Browse files Browse the repository at this point in the history
  • Loading branch information
pablonyx committed Jan 21, 2025
1 parent 37abd2b commit f6784b5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/onyx/server/query_and_chat/chat_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,9 @@ def upload_files_for_chat(
)

for file in files:
if not file.content_type:
raise HTTPException(status_code=400, detail="File content type is required")

if file.content_type not in allowed_content_types:
if file.content_type in image_content_types:
error_detail = "Unsupported image file type. Supported image types include .jpg, .jpeg, .png, .webp."
Expand Down Expand Up @@ -672,7 +675,7 @@ def upload_files_for_chat(
else:
file_content = io.BytesIO(file.file.read())

new_content_type = file.content_type or ""
new_content_type = file.content_type

# store the file (now JPEG for images)
file_id = str(uuid.uuid4())
Expand Down

0 comments on commit f6784b5

Please sign in to comment.