Set response mime_type based on Content-Type

Set the response's mime_type based on its Content-Type header whenever
Response::set_headers is called.

Fixes #24628.
This commit is contained in:
glowe 2019-11-05 19:54:50 -05:00
parent f65cb94b9e
commit e73528e5fc
3 changed files with 2 additions and 5 deletions

View file

@ -403,6 +403,7 @@ impl Response {
Some(hyper_headers) => hyper_headers.into_inner(),
None => HyperHeaders::new(),
});
*self.mime_type.borrow_mut() = self.Headers().extract_mime_type();
}
pub fn set_raw_status(&self, status: Option<(u16, Vec<u8>)>) {