cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Adding NPE guards to HTTP Headers utility, thanks to Raman Malisetti
Date Tue, 25 Nov 2014 21:40:03 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 9e0f958d8 -> 6e8b999f0


Adding NPE guards to HTTP Headers utility, thanks to Raman Malisetti


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/6e8b999f
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6e8b999f
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6e8b999f

Branch: refs/heads/3.0.x-fixes
Commit: 6e8b999f0e4f724e3e9f1a5aacef87a426d360e9
Parents: 9e0f958
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Tue Nov 25 21:35:18 2014 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Tue Nov 25 21:39:30 2014 +0000

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/transport/http/Headers.java  | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/6e8b999f/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
index 6c8dacd..620deb1 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
@@ -435,12 +435,18 @@ public class Headers {
             
             if (addHeaders || HTTP_HEADERS_SINGLE_VALUE_ONLY.contains(header)) {
                 for (int i = 0; i < headerList.size(); i++) {
-                    response.addHeader(header, headerObjectToString(headerList.get(i)));
+                    Object headerObject = headerList.get(i);
+                    if (headerObject != null) {
+                        response.addHeader(header, headerObjectToString(headerObject));
+                    }
                 }
             } else {
                 StringBuilder sb = new StringBuilder();
                 for (int i = 0; i < headerList.size(); i++) {
-                    sb.append(headerObjectToString(headerList.get(i)));
+                    Object headerObject = headerList.get(i);
+                    if (headerObject != null) {
+                        sb.append(headerObjectToString(headerObject));
+                    }
                     
                     if (i + 1 < headerList.size()) {
                         sb.append(',');


Mime
View raw message