Skip to content

Commit 92595e8

Browse files
spkseanmonstar
authored andcommitted
feat(header): add ContentType::xml() constructor
1 parent 77bfcd9 commit 92595e8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/header/common/content_type.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,18 @@ impl ContentType {
6868
ContentType(mime::TEXT_PLAIN_UTF_8)
6969
}
7070

71-
/// A constructor to easily create a `Content-Type: text/html; charset=utf-8` header.
71+
/// A constructor to easily create a `Content-Type: text/html` header.
7272
#[inline]
7373
pub fn html() -> ContentType {
7474
ContentType(mime::TEXT_HTML)
7575
}
7676

77+
/// A constructor to easily create a `Content-Type: text/xml` header.
78+
#[inline]
79+
pub fn xml() -> ContentType {
80+
ContentType(mime::TEXT_XML)
81+
}
82+
7783
/// A constructor to easily create a `Content-Type: application/www-form-url-encoded` header.
7884
#[inline]
7985
pub fn form_url_encoded() -> ContentType {

0 commit comments

Comments
 (0)