This commit is contained in:
2023-08-09 18:51:23 +02:00
parent e66a1e1343
commit 1e75381acf

View File

@@ -1,3 +1,4 @@
use base64::{engine::general_purpose, Engine};
use reqwest::{Response, multipart::{Form, Part}, header}; use reqwest::{Response, multipart::{Form, Part}, header};
use serde::Deserialize; use serde::Deserialize;
use tracing::log; use tracing::log;
@@ -57,10 +58,17 @@ pub async fn upload_to_telegram_files(
.unwrap() .unwrap()
.to_string(); .to_string();
let filename = headers let base64_encoder = general_purpose::STANDARD;
.get("x-filename-b64-ascii")
.unwrap() let filename = std::str::from_utf8(
.to_str() &base64_encoder
.decode(
headers
.get("x-filename-b64-ascii")
.unwrap()
)
.unwrap(),
)
.unwrap() .unwrap()
.to_string(); .to_string();