style: code style

This commit is contained in:
2020-08-09 21:34:57 +08:00
parent dc00f46d9f
commit 415a1fd51e

View File

@@ -41,8 +41,7 @@ async fn get_file(req: HttpRequest) -> HttpResponse {
information!("Parsed query string: {:?}", parsed_query_string); information!("Parsed query string: {:?}", parsed_query_string);
let url = match parsed_query_string.get("url") { let url = match parsed_query_string.get("url") {
None => None, Some(v) => v.iter().next().clone(), None => None,
Some(v) => v.iter().next().clone(),
}; };
let url = match url { let url = match url {
Some(u) => u, Some(u) => u,
@@ -54,8 +53,8 @@ async fn get_file(req: HttpRequest) -> HttpResponse {
Err(e) => return HttpResponse::BadGateway().content_type("text/plain") Err(e) => return HttpResponse::BadGateway().content_type("text/plain")
.body(format!("Bad gateway error: {}", e)), .body(format!("Bad gateway error: {}", e)),
}; };
let mut http_response = HttpResponse::build(resp.status());
let mut http_response = HttpResponse::build(resp.status());
let resp_headers = resp.headers(); let resp_headers = resp.headers();
information!("Response headers: {:#?}", resp_headers); information!("Response headers: {:#?}", resp_headers);
for (k, v) in resp_headers.iter() { for (k, v) in resp_headers.iter() {