mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-24 16:02:59 +01:00
fs: minor cleanups to content_disposition
This commit is contained in:
parent
6f38d769a8
commit
4d69e6d0b4
@ -276,7 +276,7 @@ impl Responder for NamedFile {
|
|||||||
if self.status_code != StatusCode::OK {
|
if self.status_code != StatusCode::OK {
|
||||||
let mut resp = HttpResponse::build(self.status_code);
|
let mut resp = HttpResponse::build(self.status_code);
|
||||||
resp.set(header::ContentType(self.content_type.clone()))
|
resp.set(header::ContentType(self.content_type.clone()))
|
||||||
.header("Content-Disposition", format!("{}", &self.content_disposition));
|
.header(header::CONTENT_DISPOSITION, self.content_disposition.to_string());
|
||||||
|
|
||||||
if let Some(current_encoding) = self.encoding {
|
if let Some(current_encoding) = self.encoding {
|
||||||
resp.content_encoding(current_encoding);
|
resp.content_encoding(current_encoding);
|
||||||
@ -327,7 +327,7 @@ impl Responder for NamedFile {
|
|||||||
|
|
||||||
let mut resp = HttpResponse::build(self.status_code);
|
let mut resp = HttpResponse::build(self.status_code);
|
||||||
resp.set(header::ContentType(self.content_type.clone()))
|
resp.set(header::ContentType(self.content_type.clone()))
|
||||||
.header("Content-Disposition", format!("{}", &self.content_disposition));
|
.header(header::CONTENT_DISPOSITION, self.content_disposition.to_string());
|
||||||
|
|
||||||
if let Some(current_encoding) = self.encoding {
|
if let Some(current_encoding) = self.encoding {
|
||||||
resp.content_encoding(current_encoding);
|
resp.content_encoding(current_encoding);
|
||||||
|
Loading…
Reference in New Issue
Block a user