Skip to content

fix: Use content based file type detection instead of client headers #519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

CyMule
Copy link

@CyMule CyMule commented Jun 23, 2025

Problem

Explicitly set content types are taken as truth. Some clients such as curl set the content type based on the file extension which may not always be accurate.

Curl docs:

If the content-type is not specified, curl tries to guess from the file extension (it only knows a few), or use the previously specified type (from an earlier file if several files are specified in a list) or else it uses the default type application/octet-stream.

Solution

Always use the unstructured detect_filetype function to intelligently determine the file type instead of expecting the provided content type to be accurate.

@CyMule CyMule closed this Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant