mirror of
https://codeberg.org/icewind/rss-webhook-trigger.git
synced 2026-11-30 04:00:49 +01:00
send user agent
This commit is contained in:
parent
988f2e4603
commit
f8b59df362
6 changed files with 21 additions and 10 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue