{"id":13822715,"url":"https://github.com/abonander/mime_guess","last_synced_at":"2025-05-15T15:05:33.550Z","repository":{"id":27947064,"uuid":"31439722","full_name":"abonander/mime_guess","owner":"abonander","description":"MIME type guessing of file extensions for Rust.","archived":false,"fork":false,"pushed_at":"2025-04-17T04:35:34.000Z","size":766,"stargazers_count":184,"open_issues_count":12,"forks_count":62,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-13T22:48:49.714Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abonander.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-02-27T21:22:32.000Z","updated_at":"2025-05-08T06:20:57.000Z","dependencies_parsed_at":"2024-06-18T16:44:41.289Z","dependency_job_id":"682b273a-c957-4c42-8746-3aa4456240ff","html_url":"https://github.com/abonander/mime_guess","commit_stats":{"total_commits":146,"total_committers":41,"mean_commits":"3.5609756097560976","dds":0.547945205479452,"last_synced_commit":"805964fb54871f0154ee155bf21729b77ffd4a1c"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abonander%2Fmime_guess","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abonander%2Fmime_guess/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abonander%2Fmime_guess/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abonander%2Fmime_guess/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abonander","download_url":"https://codeload.github.com/abonander/mime_guess/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254291777,"owners_count":22046402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T08:02:14.207Z","updated_at":"2025-05-15T15:05:33.526Z","avatar_url":"https://github.com/abonander.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# mime_guess ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/abonander/mime_guess/rust.yml?branch=master) [![Crates.io](https://img.shields.io/crates/v/mime_guess.svg)](https://crates.io/crates/mime_guess)\n\nMIME/MediaType guessing by file extension. \nUses a static map of known file extension -\u003e MIME type mappings.\n\n**Returning Contributors: New Requirements for Submissions Below**\n\n##### Required Rust Version: 1.33\n\n#### [Documentation](https://docs.rs/mime_guess/)\n\n### Versioning\n\nDue to a mistaken premature release, `mime_guess` currently publicly depends on a pre-1.0 `mime`,\nwhich means `mime` upgrades are breaking changes and necessitate a major version bump. \nRefer to the following table to find a version of `mime_guess` which matches your version of `mime`:\n\n| `mime` version | `mime_guess` version |\n|----------------|----------------------|\n| `0.1.x, 0.2.x` | `1.x.y` |\n| `0.3.x`        | `2.x.y` |\n\n#### Note: MIME Types Returned Are Not Stable/Guaranteed\nThe media types returned for a given extension are not considered to be part of the crate's\n stable API and are often updated in patch (`x.y.z + 1`) releases to be as correct as possible. MIME\n changes are backported to previous major releases on a best-effort basis.\n \nNote that only the extensions of paths/filenames are inspected in order to guess the MIME type. The\nfile that may or may not reside at that path may or may not be a valid file of the returned MIME type.\nBe wary of unsafe or un-validated assumptions about file structure or length.\n\nAn extension may also have multiple applicable MIME types. When more than one is returned, the first\nis considered to be the most \"correct\"--see below for elaboration.\n\nContributing\n-----------\n\n#### Adding or correcting MIME types for extensions\n\nIs the MIME type for a file extension wrong or missing? Great! \nWell, not great for us, but great for you if you'd like to open a pull request! \n\nThe file extension -\u003e MIME type mappings are listed in `src/mime_types.rs`. \n**The list is sorted lexicographically by file extension, and all extensions are lowercase (where applicable).** \nThe former is necessary to support fallback to binary search when the \n`phf-map` feature is turned off, and for the maintainers' sanity.\nThe latter is only for consistency's sake; the search is case-insensitive.\n\nSimply add or update the appropriate string pair(s) to make the correction(s) needed. \nRun `cargo test` to make sure the library continues to work correctly.\n\n#### Important! Citing the corrected MIME type \n\nWhen opening a pull request, please include a link to an official document or RFC noting \nthe correct MIME type for the file type in question **in the commit message** so\nthat the commit history can be used as an audit trail.\n\nThough we're only guessing here, we like to be as correct as we can. \nIt makes it much easier to vet your contribution if we don't have to search for corroborating material.\n\n#### Multiple MIME types per extension\nAs of `2.0.0`, multiple MIME types per extension are supported. The first MIME type in the list for \na given extension should be the most \"correct\" so users who only care about getting a single MIME \ntype can use the `first*()` methods.\n\nThe definition of \"correct\" is open to debate, however. In the author's opinion this should be \nwhatever is defined by the latest IETF RFC for the given file format, or otherwise explicitly \nsupercedes all others.\n\nIf an official IANA registration replaces an older \"experimental\" style media type, please\nplace the new type before the old type in the list, but keep the old type for reference:\n\n```\n- (\"md\", \u0026[\"text/x-markdown\"]),\n+ (\"md\", \u0026[\"text/markdown\", \"text/x-markdown\"]),\n```\n\n#### Changes to the API or operation of the crate\n\nWe're open to changes to the crate's API or its inner workings, breaking or not, if it improves the overall operation, efficiency, or ergonomics of the crate. However, it would be a good idea to open an issue on the repository so we can discuss your proposed changes and decide how best to approach them.\n\n\nLicense\n-------\n\nMIT (See the `LICENSE` file in this repository for more information.)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabonander%2Fmime_guess","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabonander%2Fmime_guess","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabonander%2Fmime_guess/lists"}