mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-24 07:53:00 +01:00
update changelog
This commit is contained in:
parent
174fb0b5f4
commit
556646aaec
@ -1,11 +1,13 @@
|
|||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
## [0.6.10] - 2018-05-xx
|
## [0.6.10] - 2018-05-24
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
* Allow to use path without traling slashes for scope registration #241
|
* Allow to use path without traling slashes for scope registration #241
|
||||||
|
|
||||||
|
* Allow to set encoding for exact NamedFile #239
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
* `TestServer::post()` actually sends `GET` request #240
|
* `TestServer::post()` actually sends `GET` request #240
|
||||||
|
13
src/fs.rs
13
src/fs.rs
@ -117,19 +117,13 @@ impl NamedFile {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set content encoding for serving this file
|
/// Set content encoding for serving this file
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn set_content_encoding(mut self, enc: ContentEncoding) -> Self {
|
pub fn set_content_encoding(mut self, enc: ContentEncoding) -> Self {
|
||||||
self.encoding = Some(enc);
|
self.encoding = Some(enc);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get content encoding used for serving this file
|
|
||||||
#[inline]
|
|
||||||
pub fn content_encoding(&self) -> Option<ContentEncoding> {
|
|
||||||
self.encoding
|
|
||||||
}
|
|
||||||
|
|
||||||
fn etag(&self) -> Option<header::EntityTag> {
|
fn etag(&self) -> Option<header::EntityTag> {
|
||||||
// This etag format is similar to Apache's.
|
// This etag format is similar to Apache's.
|
||||||
self.modified.as_ref().map(|mtime| {
|
self.modified.as_ref().map(|mtime| {
|
||||||
@ -968,8 +962,9 @@ mod tests {
|
|||||||
let req = TestRequest::default().method(Method::GET).finish();
|
let req = TestRequest::default().method(Method::GET).finish();
|
||||||
let file = NamedFile::open("Cargo.toml").unwrap();
|
let file = NamedFile::open("Cargo.toml").unwrap();
|
||||||
|
|
||||||
assert!(file.content_encoding().is_none());
|
assert!(file.encoding.is_none());
|
||||||
let resp = file.set_content_encoding(ContentEncoding::Identity)
|
let resp = file
|
||||||
|
.set_content_encoding(ContentEncoding::Identity)
|
||||||
.respond_to(&req)
|
.respond_to(&req)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user