From e0a350725e6ffaf3c5e5552fa172bbbd7d7b4f67 Mon Sep 17 00:00:00 2001 From: clerie Date: Sat, 27 Jul 2024 22:14:29 +0200 Subject: [PATCH] Set user agent for bahn.expoert api requests --- src/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.rs b/src/main.rs index 3b8f02f..fc58af1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -198,6 +198,7 @@ async fn route_station_to_dest_station( let client = reqwest::Client::new(); let stationdata_req = client.get(format!("https://bahn.expert/api/iris/v2/abfahrten/{}?lookahead=150&lookbehind=10", station_properties.code)) + .header(reqwest::header::USER_AGENT, "https://nurausstieg.clerie.de - abuse: nurausstieg@clerie.de") .send().await .map_err(|_err| (StatusCode::INTERNAL_SERVER_ERROR, String::from("Station Data cannot be fetched")))?;