Skip to content

mod_http_upload: missing content types #4488

@marc0s

Description

@marc0s

Some files uploaded via mod_http_upload will have the default Content-Type header value of application/octet-stream because their mapping of extension => mime type is missing from both mod_http_upload.erl and mod_http_fileserver.erl.

We're using the Content-Type header in our client to determine if the referenced file may be previewed in the conversation or just linked to it for the user to download it. When a file whose MIME type is not listed in the modules mentioned above, but it's a media file we want to embed into the conversation, we're unable to do so because it looks like a generic file. This happens with webm audio files, for instance.

To overcome this situation, I'd say we should do one of the following:

  • allow to configure the mappings of extension => mime types in one of the module's configuration in ejabberd.yml
  • create the mapping from the /etc/mime.types (or equivalent) file present in lots (almost all?) of operating systems
  • fetch the IANA mediatypes' list and generate the mapping from there (exhaustive, but I think overkill)

IMHO, the first option is both flexible and enough.

Thoughts on this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions