From 5c047beaeba858392574775af2c898041f56ceb5 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Thu, 19 Mar 2026 14:02:29 -0400 Subject: [PATCH] Change SEGMENT_API_URL to SEGMENT_BASE_URL and append endpoint path Store only the base URL (e.g. https://api.segment.io) so that different endpoints (/v1/batch, /v1/track, etc.) can reuse it. Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/crates/fabro-telemetry/src/sender.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/crates/fabro-telemetry/src/sender.rs b/lib/crates/fabro-telemetry/src/sender.rs index 1ace31111..917eaf726 100644 --- a/lib/crates/fabro-telemetry/src/sender.rs +++ b/lib/crates/fabro-telemetry/src/sender.rs @@ -6,9 +6,9 @@ use uuid::Uuid; use crate::event::Track; -const SEGMENT_API_URL: &str = match option_env!("SEGMENT_API_URL") { +const SEGMENT_BASE_URL: &str = match option_env!("SEGMENT_BASE_URL") { Some(url) => url, - None => "https://api.segment.io/v1/batch", + None => "https://api.segment.io", }; const SEGMENT_WRITE_KEY: Option<&str> = option_env!("SEGMENT_WRITE_KEY"); @@ -92,7 +92,7 @@ pub async fn upload(path: &Path) -> anyhow::Result<()> { let auth = STANDARD.encode(format!("{write_key}:")); let resp = reqwest::Client::new() - .post(SEGMENT_API_URL) + .post(format!("{SEGMENT_BASE_URL}/v1/batch")) .header("Authorization", format!("Basic {auth}")) .json(&payload) .send()