This commit is contained in:
2023-08-10 00:28:53 +02:00
parent 8002d84912
commit e5eba1c6a6
2 changed files with 3 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ pub struct Config {
pub book_library_url: String, pub book_library_url: String,
pub converter_url: String, pub converter_url: String,
pub converter_api_key: String,
pub sentry_dsn: String pub sentry_dsn: String
} }
@@ -35,6 +36,7 @@ impl Config {
book_library_url: get_env("BOOK_LIBRARY_URL"), book_library_url: get_env("BOOK_LIBRARY_URL"),
converter_url: get_env("CONVERTER_URL"), converter_url: get_env("CONVERTER_URL"),
converter_api_key: get_env("CONVERTER_API_KEY"),
sentry_dsn: get_env("SENTRY_DSN") sentry_dsn: get_env("SENTRY_DSN")
} }

View File

@@ -18,6 +18,7 @@ pub async fn convert_file(file: SpooledTempFile, file_type: String) -> Option<Re
let response = client let response = client
.post(&config::CONFIG.converter_url) .post(&config::CONFIG.converter_url)
.multipart(form) .multipart(form)
.header("Authorization", &config::CONFIG.converter_api_key)
.send().await; .send().await;
let response = match response { let response = match response {