-
-
Notifications
You must be signed in to change notification settings - Fork 867
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
S3BotoStorage doesn't properly fallback to other Content-Type heuristics #406
Comments
@bxm156 Are you using django-filer to upload the file in the admin? |
I encountered this issue today using the s3boto3 backend when dealing with a certain .ico file and reached the same conclusion as the OP. I'm not using django-filer
Could be changed to something like the following. Keeping the linebreaks for easier comparison:
What do you think? |
@alexhayes Yes, I was using django-filer. However it seems like @willplaehn is not. |
I'm using Django Filler as well, and this is happening for me as well |
Content Type is determined by the following:
If the
content-type
property doesn't exist, the logic falls back to 2 and 3. But the logic doesn't properly fallback if the content_type exists, but it set to None.I found that in django my InMemoryFileUpload had a content_type of None. And so django-storages would try to make a s3 upload via boto3 with the following params {"Content-Type:": None}
This would cause boto to crash with
Invalid type for parameter ContentType, value: None, type: <class 'NoneType'>, valid types: <class 'str'>
The text was updated successfully, but these errors were encountered: