cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asold...@apache.org
Subject [1/2] cxf git commit: cxf-6484
Date Wed, 22 Jul 2015 19:34:26 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes a70005059 -> 2ed09a67d


cxf-6484


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

Branch: refs/heads/2.7.x-fixes
Commit: f7a8009fc9cffd40d34d23279ca25d7f5e4880cb
Parents: 0c637e9
Author: Chris Dolphy <chris.dolphy@redhat.com>
Authored: Thu Jul 2 22:43:32 2015 -0500
Committer: Chris Dolphy <chris.dolphy@redhat.com>
Committed: Thu Jul 2 22:43:32 2015 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/attachment/AttachmentUtil.java  | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/f7a8009f/api/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java b/api/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
index e027d75..7ca5877 100644
--- a/api/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
+++ b/api/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
@@ -24,6 +24,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
 import java.net.MalformedURLException;
+import java.net.URI;
 import java.net.URL;
 import java.net.URLDecoder;
 import java.net.URLEncoder;
@@ -196,7 +197,12 @@ public final class AttachmentUtil {
         
         String name = ATT_UUID + "-" + String.valueOf(++counter);
         if (ns != null && (ns.length() > 0)) {
-            cid = ns;
+            try {
+                URI uri = new URI(ns);
+                cid = uri.getHost();
+            } catch (Exception e) {
+                cid = ns;
+            }
         }
         return URLEncoder.encode(name, "UTF-8") + "@" + URLEncoder.encode(cid, "UTF-8");
     }


Mime
View raw message