Removes redundant client configuration
All checks were successful
Build, Push and Run Container / build (push) Successful in 25s

Removes the redundant base address and header configurations from within the endpoint handler. This configuration should be handled elsewhere, avoiding unnecessary repetition.
This commit is contained in:
2025-08-18 12:34:07 +02:00
parent f06dd72213
commit d291e6ec3e

View File

@@ -283,10 +283,6 @@ if (app.Environment.IsDevelopment())
if (vins.Length == 0) if (vins.Length == 0)
return Results.Ok("No cars found"); 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); HttpResponseMessage response = await client.PostAsJsonAsync("/api/1/vehicles/fleet_telemetry_config", configRequest);
return Results.Ok(response.Content.ReadAsStringAsync()); return Results.Ok(response.Content.ReadAsStringAsync());
}); });