From ee85f261525ca9e0b93f6fedbfcf6ecbe1737243 Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Fri, 5 Sep 2025 15:16:44 +0200 Subject: [PATCH 1/2] Change root endpoint to GET method This is just a test.. for some reason HEAD is not allowed in staging although it works on edge --- .../MappingsExstension.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/Elastic.Documentation.Api.Infrastructure/MappingsExstension.cs b/src/api/Elastic.Documentation.Api.Infrastructure/MappingsExstension.cs index dbbdff5b1..0e49d80c7 100644 --- a/src/api/Elastic.Documentation.Api.Infrastructure/MappingsExstension.cs +++ b/src/api/Elastic.Documentation.Api.Infrastructure/MappingsExstension.cs @@ -15,7 +15,7 @@ public static class MappingsExtension { public static void MapElasticDocsApiEndpoints(this IEndpointRouteBuilder group) { - _ = group.MapMethods("/", [HttpMethods.Head], () => Results.Empty); + _ = group.MapGet("/", () => Results.Empty); MapAskAiEndpoint(group); MapSearchEndpoint(group); } From 8dde2d20af47e428998760fda9e98974c75bb463 Mon Sep 17 00:00:00 2001 From: Jan Calanog Date: Fri, 5 Sep 2025 15:21:33 +0200 Subject: [PATCH 2/2] Use GET instead head Because the endpoint changed --- .../Assets/web-components/SearchOrAskAi/SearchOrAskAiButton.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Elastic.Documentation.Site/Assets/web-components/SearchOrAskAi/SearchOrAskAiButton.tsx b/src/Elastic.Documentation.Site/Assets/web-components/SearchOrAskAi/SearchOrAskAiButton.tsx index 3ca8cdc1c..18f914b47 100644 --- a/src/Elastic.Documentation.Site/Assets/web-components/SearchOrAskAi/SearchOrAskAiButton.tsx +++ b/src/Elastic.Documentation.Site/Assets/web-components/SearchOrAskAi/SearchOrAskAiButton.tsx @@ -33,7 +33,7 @@ export const SearchOrAskAiButton = () => { const { data: isApiAvailable } = useQuery({ queryKey: ['api-health'], queryFn: async () => { - const response = await fetch('/docs/_api/v1/', { method: 'HEAD' }) + const response = await fetch('/docs/_api/v1/') return response.ok }, staleTime: 5 * 60 * 1000, // 5 minutes