diff --git a/CHANGES.md b/CHANGES.md index 0bf976833..2c1e94bed 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,11 +1,13 @@ # Changes -## [0.6.10] - 2018-05-xx +## [0.6.10] - 2018-05-24 ### Added * Allow to use path without traling slashes for scope registration #241 +* Allow to set encoding for exact NamedFile #239 + ### Fixed * `TestServer::post()` actually sends `GET` request #240 diff --git a/src/fs.rs b/src/fs.rs index e7d4a9f74..a8f66dede 100644 --- a/src/fs.rs +++ b/src/fs.rs @@ -117,19 +117,13 @@ impl NamedFile { self } - // Set content encoding for serving this file + /// Set content encoding for serving this file #[inline] pub fn set_content_encoding(mut self, enc: ContentEncoding) -> Self { self.encoding = Some(enc); self } - // Get content encoding used for serving this file - #[inline] - pub fn content_encoding(&self) -> Option { - self.encoding - } - fn etag(&self) -> Option { // This etag format is similar to Apache's. self.modified.as_ref().map(|mtime| { @@ -968,8 +962,9 @@ mod tests { let req = TestRequest::default().method(Method::GET).finish(); let file = NamedFile::open("Cargo.toml").unwrap(); - assert!(file.content_encoding().is_none()); - let resp = file.set_content_encoding(ContentEncoding::Identity) + assert!(file.encoding.is_none()); + let resp = file + .set_content_encoding(ContentEncoding::Identity) .respond_to(&req) .unwrap();