chore: cleanup
This commit is contained in:
parent
1c917722a6
commit
d55c8b1164
@ -38,8 +38,7 @@ impl Service<Request<Body>> for Svc {
|
|||||||
let addr = self.1.clone();
|
let addr = self.1.clone();
|
||||||
let router = self.2.clone();
|
let router = self.2.clone();
|
||||||
Box::pin(async move {
|
Box::pin(async move {
|
||||||
let uri = parts.uri.path().to_string();
|
let lua_handle_match = match router.at(parts.uri.path()) {
|
||||||
let lua_handle_match = match router.at(uri.as_str()) {
|
|
||||||
Ok(res) => res,
|
Ok(res) => res,
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
return Ok(Response::builder()
|
return Ok(Response::builder()
|
||||||
@ -85,21 +84,16 @@ impl Service<Request<Body>> for Svc {
|
|||||||
let mut multipart = Multipart::with_body(Cursor::new(body_bytes), boundary);
|
let mut multipart = Multipart::with_body(Cursor::new(body_bytes), boundary);
|
||||||
multipart
|
multipart
|
||||||
.foreach_entry(|mut arg| {
|
.foreach_entry(|mut arg| {
|
||||||
let mut buf = String::new();
|
let mut content = String::new();
|
||||||
let name = arg.headers.name;
|
let name = arg.headers.name;
|
||||||
arg.data.read_to_string(&mut buf).unwrap();
|
arg.data.read_to_string(&mut content).unwrap();
|
||||||
match arg.headers.filename {
|
match arg.headers.filename {
|
||||||
Some(filename) => {
|
Some(filename) => {
|
||||||
parts_map.insert(
|
parts_map
|
||||||
name.to_string(),
|
.insert(name.to_string(), Part { filename, content });
|
||||||
Part {
|
|
||||||
filename,
|
|
||||||
content: buf,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
form_map.insert(name.to_string(), buf);
|
form_map.insert(name.to_string(), content);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
()
|
()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user