This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch 3.2
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.2 by this push:
     new 35746aaf5a Fix rest protocol NPE when using apache-http-client 
(#12916) (#12984)
35746aaf5a is described below

commit 35746aaf5a3e6eab9181fedb37fd8cc00793469c
Author: aofall <[email protected]>
AuthorDate: Tue Sep 5 11:22:21 2023 +0800

    Fix rest protocol NPE when using apache-http-client (#12916) (#12984)
---
 .../apache/dubbo/remoting/http/restclient/HttpClientRestClient.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/dubbo-remoting/dubbo-remoting-http/src/main/java/org/apache/dubbo/remoting/http/restclient/HttpClientRestClient.java
 
b/dubbo-remoting/dubbo-remoting-http/src/main/java/org/apache/dubbo/remoting/http/restclient/HttpClientRestClient.java
index 0344a4aab9..f8f85411af 100644
--- 
a/dubbo-remoting/dubbo-remoting-http/src/main/java/org/apache/dubbo/remoting/http/restclient/HttpClientRestClient.java
+++ 
b/dubbo-remoting/dubbo-remoting-http/src/main/java/org/apache/dubbo/remoting/http/restclient/HttpClientRestClient.java
@@ -93,7 +93,8 @@ public class HttpClientRestClient implements RestClient {
             future.complete(new RestResult() {
                 @Override
                 public String getContentType() {
-                    return response.getFirstHeader("Content-Type").getValue();
+                    Header header = response.getFirstHeader("Content-Type");
+                    return header == null ? null : header.getValue();
                 }
 
                 @Override

Reply via email to