From 580806bd4b1a9988d4c42ac4c510461bc1ff0121 Mon Sep 17 00:00:00 2001 From: Ronaldo Macapobre Date: Thu, 7 Nov 2024 21:58:38 +0000 Subject: [PATCH] Add x-api-key for LocationServiceClient --- api/Infrastructure/ServiceCollectionExtensions.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/Infrastructure/ServiceCollectionExtensions.cs b/api/Infrastructure/ServiceCollectionExtensions.cs index 6b1a6720..43dc10fa 100644 --- a/api/Infrastructure/ServiceCollectionExtensions.cs +++ b/api/Infrastructure/ServiceCollectionExtensions.cs @@ -61,6 +61,8 @@ public static IServiceCollection AddHttpClientsAndScvServices(this IServiceColle // configuration.GetNonEmptyValue("LocationServicesClient:Username"), // configuration.GetNonEmptyValue("LocationServicesClient:Password")); client.BaseAddress = new Uri(configuration.GetNonEmptyValue("LocationServicesClient:Url").EnsureEndingForwardSlash()); + var apiKey = configuration.GetNonEmptyValue("AWS_API_GATEWAY_API_KEY"); + client.DefaultRequestHeaders.Add("x-api-key", apiKey); }).AddHttpMessageHandler(); services.AddHttpClient(client =>