Picture with no extension results in Content-Type: application/octet-stream

Created on 3 December 2020, almost 4 years ago
Updated 5 April 2023, over 1 year ago

Problem/Motivation

When userinfo returns a picture without an extension we don't have accurate content type information. When used in conjunction with the s3fs project (which uses drupals file mime type guess) we end up uploading to Amazon S3 with application/octet-stream content type which breaks the picture.

Proposed resolution

Detect headers from file_get_contents and add an extension if one isn't present. I have a patch which does this to solve my current needs but haven't tested all cases.

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States kdmcclel

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024