mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-25 18:09:22 +02:00
update changelog
This commit is contained in:
13
src/fs.rs
13
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<ContentEncoding> {
|
||||
self.encoding
|
||||
}
|
||||
|
||||
fn etag(&self) -> Option<header::EntityTag> {
|
||||
// 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();
|
||||
|
||||
|
Reference in New Issue
Block a user