From d291e6ec3e25b31f444e4cca2d60982f48166650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szak=C3=A1ts=20Alp=C3=A1r=20Zsolt?= Date: Mon, 18 Aug 2025 12:34:07 +0200 Subject: [PATCH] Removes redundant client configuration Removes the redundant base address and header configurations from within the endpoint handler. This configuration should be handled elsewhere, avoiding unnecessary repetition. --- Source/ProofOfConcept/Program.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Source/ProofOfConcept/Program.cs b/Source/ProofOfConcept/Program.cs index 20960f7..798b1dc 100644 --- a/Source/ProofOfConcept/Program.cs +++ b/Source/ProofOfConcept/Program.cs @@ -283,10 +283,6 @@ if (app.Environment.IsDevelopment()) if (vins.Length == 0) return Results.Ok("No cars found"); - client.BaseAddress = new Uri("https://fleet-api.prd.eu.vn.cloud.tesla.com"); - client.DefaultRequestHeaders.Add("Authorization", $"Bearer {access_token}"); - client.DefaultRequestHeaders.Add("X-Tesla-User-Agent", "Tesla-Connector/1.0.0"); - HttpResponseMessage response = await client.PostAsJsonAsync("/api/1/vehicles/fleet_telemetry_config", configRequest); return Results.Ok(response.Content.ReadAsStringAsync()); });