Skip to content

Mime detection panic #6

Description

@gus4rs

Sometimes, with perfectly valid JPEG media, the pub async fn upload_media fails to recognise the media mime type at line

mime = infer::get(&file_bytes).unwrap().mime_type().to_string();

The error is

thread 'tokio-runtime-worker' panicked at 'called `Option::unwrap()` on a `None` value

It should not panic, ideally upload_media should accept an optional parameter with the media type to avoid this flawed detection

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions