diff --git a/spring-cloud-function-adapters/spring-cloud-function-adapter-azure-web/src/main/java/org/springframework/cloud/function/adapter/azure/web/AzureWebProxyInvoker.java b/spring-cloud-function-adapters/spring-cloud-function-adapter-azure-web/src/main/java/org/springframework/cloud/function/adapter/azure/web/AzureWebProxyInvoker.java index 1a09998cb..d2a214526 100644 --- a/spring-cloud-function-adapters/spring-cloud-function-adapter-azure-web/src/main/java/org/springframework/cloud/function/adapter/azure/web/AzureWebProxyInvoker.java +++ b/spring-cloud-function-adapters/spring-cloud-function-adapter-azure-web/src/main/java/org/springframework/cloud/function/adapter/azure/web/AzureWebProxyInvoker.java @@ -93,7 +93,7 @@ private HttpServletRequest prepareRequest(HttpRequestMessage> r request.getBody().ifPresent(body -> { - Charset charsetEncoding = request.getHeaders().containsKey("content-encoding") + Charset charsetEncoding = request.getHeaders() != null && request.getHeaders().containsKey("content-encoding") ? Charset.forName(request.getHeaders().get("content-encoding")) : StandardCharsets.UTF_8; httpRequest.setContent(body.getBytes(charsetEncoding));