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

add mime types for marckdown, latex, vega, geojson, fasta #92

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,13 +501,23 @@ names! {
CSV, "csv";
EVENT_STREAM, "event-stream";
VCARD, "vcard";
MARKDOWN, "markdown";
LATEX, "latex";

// common application/*
JSON, "json";
WWW_FORM_URLENCODED, "x-www-form-urlencoded";
MSGPACK, "msgpack";
OCTET_STREAM, "octet-stream";
PDF, "pdf";
VEGA_V2, "vnd.vega.v2";
VEGA_V3, "vnd.vega.v3";
VEGALITE_V1, "vnd.vegalite.v1+json";
VEGALITE_V2, "vnd.vegalite.v2+json";
VEGALITE_V3, "vnd.vegalite.v3+json";
PLOTY, "vnd.plotly.v1+json";
GEOJSON, "geo+json";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of these new Name constants are actually a subtype+suffix. They should probably be removed, because this would be confusing:

// assertion fails
assert_eq!(APPLICATION_GEOJSON.subtype(), GEOJSON);

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not sur about adding them in the section "common application/*", may be could remove them all (there are not so common.

FASTA, "vnd.fasta.fasta";

// common font/*
WOFF, "woff";
Expand Down Expand Up @@ -656,6 +666,8 @@ mimes! {
TEXT_TAB_SEPARATED_VALUES, "text/tab-separated-values", 4;
TEXT_TAB_SEPARATED_VALUES_UTF_8, "text/tab-separated-values; charset=utf-8", 4, None, 25;
TEXT_VCARD, "text/vcard", 4;
TEXT_MARKDOWN, "text/markdown", 4;
TEXT_LATEX, "text/latex", 4;

IMAGE_STAR, "image/*", 5;
IMAGE_JPEG, "image/jpeg", 5;
Expand All @@ -675,6 +687,14 @@ mimes! {
APPLICATION_MSGPACK, "application/msgpack", 11;
APPLICATION_PDF, "application/pdf", 11;
APPLICATION_DNS, "application/dns-message", 11;
APPLICATION_VEGA_V2, "application/vnd.vega.v2+json", 11, Some(23);
APPLICATION_VEGA_V3, "application/vnd.vega.v3+json", 11, Some(23);
APPLICATION_VEGALITE_V1, "application/vnd.vegalite.v1+json", 11, Some(27);
APPLICATION_VEGALITE_V2, "application/vnd.vegalite.v2+json", 11, Some(27);
APPLICATION_VEGALITE_V3, "application/vnd.vegalite.v3+json", 11, Some(27);
APPLICATION_PLOTY, "application/vnd.plotly.v1+json", 11, Some(25);
APPLICATION_GEOJSON, "application/geo+json", 11, Some(15);
APPLICATION_FASTA, "application/vnd.fasta.fasta", 11;

MULTIPART_FORM_DATA, "multipart/form-data", 9;
}
Expand Down