mirror of
https://github.com/TeamPiped/piped-proxy.git
synced 2024-12-06 19:16:48 +01:00
Simplify if unwrapping.
This commit is contained in:
+1
-4
@@ -157,10 +157,7 @@ async fn index(req: HttpRequest) -> Result<HttpResponse, Box<dyn Error>> {
|
||||
}
|
||||
}
|
||||
|
||||
let content_type = resp.headers().get("content-type");
|
||||
|
||||
if content_type.is_some() {
|
||||
let content_type = content_type.unwrap();
|
||||
if let Some(content_type) = resp.headers().get("content-type") {
|
||||
if content_type == "image/jpeg" {
|
||||
let resp_bytes = resp.bytes().await.unwrap();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user