From 1a35310273732acbf8e8498ebb5dbad3d61386cb Mon Sep 17 00:00:00 2001 From: taku0 Date: Wed, 3 May 2017 18:14:52 +0900 Subject: [PATCH] feat(headers): add ContentType::octet_stream() constructor --- src/header/common/content_type.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/header/common/content_type.rs b/src/header/common/content_type.rs index 7f37581b99..41179b5699 100644 --- a/src/header/common/content_type.rs +++ b/src/header/common/content_type.rs @@ -95,6 +95,12 @@ impl ContentType { pub fn png() -> ContentType { ContentType(mime!(Image/Png)) } + + /// A constructor to easily create a `Content-Type: application/octet-stream` header. + #[inline] + pub fn octet_stream() -> ContentType { + ContentType(mime!(Application/OctetStream)) + } } impl Eq for ContentType {}