From 2988a84e5f0f70171667383396993457de2ceb06 Mon Sep 17 00:00:00 2001 From: Douman Date: Thu, 19 Jul 2018 20:03:45 +0300 Subject: [PATCH] Expose leaked private ContentDisposition (#406) --- src/header/shared/charset.rs | 8 ++++---- src/lib.rs | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/header/shared/charset.rs b/src/header/shared/charset.rs index 540dc4f28..b679971b0 100644 --- a/src/header/shared/charset.rs +++ b/src/header/shared/charset.rs @@ -66,7 +66,7 @@ pub enum Charset { } impl Charset { - fn name(&self) -> &str { + fn label(&self) -> &str { match *self { Us_Ascii => "US-ASCII", Iso_8859_1 => "ISO-8859-1", @@ -90,7 +90,7 @@ impl Charset { Iso_8859_8_E => "ISO-8859-8-E", Iso_8859_8_I => "ISO-8859-8-I", Gb2312 => "GB2312", - Big5 => "5", + Big5 => "big5", Koi8_R => "KOI8-R", Ext(ref s) => s, } @@ -99,7 +99,7 @@ impl Charset { impl Display for Charset { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str(self.name()) + f.write_str(self.label()) } } @@ -129,7 +129,7 @@ impl FromStr for Charset { "ISO-8859-8-E" => Iso_8859_8_E, "ISO-8859-8-I" => Iso_8859_8_I, "GB2312" => Gb2312, - "5" => Big5, + "big5" => Big5, "KOI8-R" => Koi8_R, s => Ext(s.to_owned()), }) diff --git a/src/lib.rs b/src/lib.rs index b33f1186a..0ab4a1bef 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -266,6 +266,7 @@ pub mod http { /// Various http headers pub mod header { pub use header::*; + pub use header::{ContentDisposition, DispositionType, DispositionParam, Charset, LanguageTag}; } pub use header::ContentEncoding; pub use httpresponse::ConnectionType;