From 73761f06397561595f650d5c1ee501e2c36e188b Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Thu, 7 Mar 2024 13:30:43 +0200 Subject: [PATCH] Explicitly set all HTTP methods for Azure Functions It appears that failure to do so results in the generated metadata not automatically including them (as opposed to what the javadoc of @HttpTrigger says) Fixes: #39242 --- .../quarkus/azure/functions/resteasy/runtime/Function.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extensions/azure-functions-http/runtime/src/main/java/io/quarkus/azure/functions/resteasy/runtime/Function.java b/extensions/azure-functions-http/runtime/src/main/java/io/quarkus/azure/functions/resteasy/runtime/Function.java index 3bfb8bdd2684b..e34cd8f0099d1 100644 --- a/extensions/azure-functions-http/runtime/src/main/java/io/quarkus/azure/functions/resteasy/runtime/Function.java +++ b/extensions/azure-functions-http/runtime/src/main/java/io/quarkus/azure/functions/resteasy/runtime/Function.java @@ -1,5 +1,7 @@ package io.quarkus.azure.functions.resteasy.runtime; +import static com.microsoft.azure.functions.HttpMethod.*; + import java.util.Optional; import com.microsoft.azure.functions.ExecutionContext; @@ -15,7 +17,9 @@ public class Function extends BaseFunction { @FunctionName(QUARKUS_HTTP) public HttpResponseMessage run( - @HttpTrigger(name = "req", dataType = "binary", route = "{*path}", authLevel = AuthorizationLevel.ANONYMOUS) HttpRequestMessage> request, + @HttpTrigger(name = "req", dataType = "binary", route = "{*path}", authLevel = AuthorizationLevel.ANONYMOUS, methods = { + GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, + PATCH }) HttpRequestMessage> request, ExecutionContext context) { return dispatch(request);