From 74d0d96101d31e45e7beffd2108bfca38a196852 Mon Sep 17 00:00:00 2001 From: Oleg Zhurakousky Date: Thu, 12 Oct 2023 17:01:36 +0200 Subject: [PATCH] Fix test --- .../cloud/function/adapter/azure/web/AzureWebProxyInvoker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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));