send user agent

This commit is contained in:
Robin Appelman 2024-12-26 00:53:17 +01:00
commit f8b59df362
6 changed files with 21 additions and 10 deletions

View file

@ -14,12 +14,15 @@ use std::future::ready;
use std::hash::{Hash, Hasher};
use std::str::FromStr;
use std::time::{Duration};
use reqwest::header::{HeaderValue, USER_AGENT};
use syndication::Feed;
use tokio::select;
use tokio::signal::ctrl_c;
use tokio::time::sleep;
use tracing::{debug, error, info, instrument, warn};
const FETCHER_USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"), "(", env!("CARGO_PKG_REPOSITORY"), ")");
#[tokio::main]
async fn main() -> MainResult {
tracing_subscriber::fmt::init();
@ -192,6 +195,7 @@ impl FeedFetcher {
.client
.get(feed)
.headers(cache_headers.headers())
.header(USER_AGENT, HeaderValue::from_static(FETCHER_USER_AGENT))
.send()
.await;