Skip to content

Commit 54b8bc5

Browse files
denisbrodbeckjbr
authored andcommitted
Add mime type XML
closes #192
1 parent ff7f5b4 commit 54b8bc5

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/body.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ impl Body {
214214
/// # async_std::task::block_on(async {
215215
/// use http_types::Body;
216216
/// use async_std::io::Cursor;
217-
///
217+
///
218218
/// let cursor = Cursor::new("Hello Nori");
219219
/// let body = Body::from_reader(cursor, None);
220220
/// assert_eq!(&body.into_string().await.unwrap(), "Hello Nori");
@@ -497,6 +497,7 @@ fn guess_ext(path: &std::path::Path) -> Option<Mime> {
497497
Some("json") => Some(mime::JSON),
498498
Some("css") => Some(mime::CSS),
499499
Some("svg") => Some(mime::SVG),
500+
Some("xml") => Some(mime::XML),
500501
None | Some(_) => None,
501502
}
502503
}

src/mime/constants.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ utf8_mime_const!(JAVASCRIPT, "JavaScript", "application", "javascript");
4747
utf8_mime_const!(CSS, "CSS", "text", "css");
4848
utf8_mime_const!(HTML, "HTML", "text", "html");
4949
utf8_mime_const!(PLAIN, "Plain text", "text", "plain");
50+
utf8_mime_const!(XML, "XML", "application", "xml");
5051
mime_const!(ANY, "matching anything", "*", "*");
5152
mime_const!(JSON, "JSON", "application", "json");
5253
mime_const!(SVG, "SVG", "image", "svg+xml");

0 commit comments

Comments
 (0)