multipart fix
This commit is contained in:
parent
f352c98e93
commit
a33456d12a
@ -110,11 +110,14 @@ impl Body {
|
|||||||
Some((name.to_lowercase(), value.to_string()))
|
Some((name.to_lowercase(), value.to_string()))
|
||||||
}).collect::<Vec<(String, String)>>();
|
}).collect::<Vec<(String, String)>>();
|
||||||
let content_type = head.iter()
|
let content_type = head.iter()
|
||||||
.find(|o| o.0.to_lowercase() == "content-type")
|
.find(|o| o.0 == "content-type")
|
||||||
.map(|o| o.1.clone());
|
.map(|o| o.1.clone());
|
||||||
let (name, filename) = head.iter()
|
let (name, filename) = head.iter()
|
||||||
.find(|o| o.0.to_lowercase() == "content-disposition")
|
.find(|o| o.0 == "content-disposition")
|
||||||
.map(|o| o.1.split(";").filter(|o| o == &"form-data").map(|s| s.trim().to_string()).collect::<Vec<String>>())
|
.map(|o| o.1.split(";")
|
||||||
|
.filter(|o| o != &"form-data")
|
||||||
|
.map(|s| s.trim().to_string())
|
||||||
|
.collect::<Vec<String>>())
|
||||||
.map(|o| (
|
.map(|o| (
|
||||||
o.iter().find(|k| k.starts_with("name=\"")).map(|k| k[6..k.len()-1].to_string()),
|
o.iter().find(|k| k.starts_with("name=\"")).map(|k| k[6..k.len()-1].to_string()),
|
||||||
o.iter().find(|k| k.starts_with("filename=\"")).map(|k| k[10..k.len()-1].to_string())
|
o.iter().find(|k| k.starts_with("filename=\"")).map(|k| k[10..k.len()-1].to_string())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user