Skip to content
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

consider supporting custom mime type in serve_dir? #500

Open
1 task done
ibigbug opened this issue Aug 2, 2024 · 0 comments
Open
1 task done

consider supporting custom mime type in serve_dir? #500

ibigbug opened this issue Aug 2, 2024 · 0 comments

Comments

@ibigbug
Copy link

ibigbug commented Aug 2, 2024

  • 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant