Update to released mime_guess v2.0

This commit is contained in:
Sean McArthur
2019-08-14 11:36:42 -07:00
parent d29e12db10
commit 7d04fa1dfa
2 changed files with 2 additions and 2 deletions

View File

@@ -23,7 +23,7 @@ hyper = "0.12.22"
flate2 = { version = "^1.0.7", default-features = false, features = ["rust_backend"] }
log = "0.4"
mime = "0.3.7"
mime_guess = "2.0.0-alpha.6"
mime_guess = "2.0"
serde = "1.0"
serde_json = "1.0"
serde_urlencoded = "0.5"

View File

@@ -213,7 +213,7 @@ impl Part {
let ext = path.extension()
.and_then(|ext| ext.to_str())
.unwrap_or("");
let mime = mime_guess::get_mime_type(ext);
let mime = mime_guess::from_ext(ext).first_or_octet_stream();
let file = File::open(path)?;
let field = Part::new(Body::from(file))
.mime(mime);