Thanks to visit codestin.com
Credit goes to github.com

Skip to content

consider supporting custom mime type in serve_dir? #500

@ibigbug

Description

@ibigbug
  • I have looked for existing issues (including closed) about this

Feature Request

current mime_guess is a hardcoded list.

taking a callback to optionally allow mapping certain file exts to something other than the hardcoded list would be helpful

Motivation

some types are missed in the mime_guess, and sometimes people may want to intentionally override the mime for well known file types

Proposal

take a callback and if it's set, preferred over here https://github.com/tower-rs/tower-http/blob/main/tower-http/src/services/fs/serve_dir/open_file.rs#L76

Alternatives

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions