make mime public

Signed-off-by: Yoshua Wuyts <yoshuawuyts@gmail.com>
This commit is contained in:
Yoshua Wuyts 2019-11-14 16:47:39 +01:00
parent 8eabbfec6e
commit 73f242a650
No known key found for this signature in database
GPG Key ID: 24EA8164F96777ED
2 changed files with 31 additions and 32 deletions

View File

@ -21,38 +21,7 @@ pub mod url {
}
pub mod headers;
/// IANA Media Types.
///
/// [Read more](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types).
pub mod mime {
/// Content-Type for JavaScript.
pub const JAVASCRIPT: &'static str = "application/javascript; charset=utf-8";
/// Content-Type for JSON.
pub const JSON: &'static str = "application/json";
/// Content-Type for CSS.
pub const CSS: &'static str = "text/css; charset=utf-8";
/// Content-Type for HTML.
pub const HTML: &'static str = "text/html; charset=utf-8";
/// Content-Type for Server Sent Events
pub const SSE: &'static str = "text/event-stream;";
/// Content-Type for plain text.
pub const PLAIN: &'static str = "text/plain; charset=utf-8";
/// Content-Type for byte streams.
pub const BYTE_STREAM: &'static str = "application/octet-stream";
/// Content-Type for form.
pub const FORM: &'static str = "application/x-www-urlencoded";
/// Content-Type for a multipart form.
pub const MULTIPART_FORM: &'static str = "multipart/form-data";
}
pub mod mime;
/// Security headers.
pub mod secure {

30
src/mime.rs Normal file
View File

@ -0,0 +1,30 @@
//! IANA Media Types.
//!
//! [Read more](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types).
/// Content-Type for JavaScript.
pub const JAVASCRIPT: &'static str = "application/javascript; charset=utf-8";
/// Content-Type for JSON.
pub const JSON: &'static str = "application/json";
/// Content-Type for CSS.
pub const CSS: &'static str = "text/css; charset=utf-8";
/// Content-Type for HTML.
pub const HTML: &'static str = "text/html; charset=utf-8";
/// Content-Type for Server Sent Events
pub const SSE: &'static str = "text/event-stream;";
/// Content-Type for plain text.
pub const PLAIN: &'static str = "text/plain; charset=utf-8";
/// Content-Type for byte streams.
pub const BYTE_STREAM: &'static str = "application/octet-stream";
/// Content-Type for form.
pub const FORM: &'static str = "application/x-www-urlencoded";
/// Content-Type for a multipart form.
pub const MULTIPART_FORM: &'static str = "multipart/form-data";