From 3321918c009e9d7a7a3c3c2a1f490bb91fefb2bc Mon Sep 17 00:00:00 2001 From: A Farzat Date: Wed, 11 Feb 2026 10:09:32 +0300 Subject: Add reqwest HttpClient skeleton (cookies-only) - Build a reqwest::Client with Cookie and browser-like default headers - Wire into main without performing any HTTP calls Note: Keep cookie header internal; never log values --- src/main.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index e582af9..6981b8e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,15 +2,16 @@ mod cli; mod config; mod cookies; mod display; +mod http_client; use clap::Parser; use cli::Args; use cookies::CookieStore; use display::Display; +use http_client::HttpClient; fn main() { let args = Args::parse(); - let mut ui = Display::new(&args.bookid); let cookies_path = config::cookies_file(); @@ -38,6 +39,13 @@ fn main() { names.join(", ") )); + // Build the HTTP client with our cookies (no network calls yet). + let _client = match HttpClient::from_store(&store) { + Ok(c) => c, + Err(e) => ui.error_and_exit(&format!("Failed to build HTTP client: {e}")), + }; + ui.info("HTTP client initialized with cookies (no requests performed)."); + let output_dir = config::books_root().join(format!("(pending) ({})", args.bookid)); ui.set_output_dir(output_dir); -- cgit v1.2.3-70-g09d2