You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2013/11/12 17:57:31 UTC

svn commit: r1541141 - /cxf/trunk/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java

Author: dkulp
Date: Tue Nov 12 16:57:31 2013
New Revision: 1541141

URL: http://svn.apache.org/r1541141
Log:
[CXF-5368] Check for both filename and name in Content-Disposition

Modified:
    cxf/trunk/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java

Modified: cxf/trunk/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java
URL: http://svn.apache.org/viewvc/cxf/trunk/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java?rev=1541141&r1=1541140&r2=1541141&view=diff
==============================================================================
--- cxf/trunk/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java (original)
+++ cxf/trunk/core/src/main/java/org/apache/cxf/attachment/AttachmentUtil.java Tue Nov 12 16:57:31 2013
@@ -348,7 +348,12 @@ public final class AttachmentUtil {
             return null;
         }
         //TODO: save ContentDisposition directly 
-        return new ContentDisposition(cd).getParameter("filename");
+        ContentDisposition c = new ContentDisposition(cd);
+        String s = c.getParameter("filename");
+        if (s == null) {
+            s = c.getParameter("name");
+        }
+        return s;
     }
     
     public static InputStream decode(InputStream in, String encoding) throws IOException {