Author: scheu
Date: Fri May 30 14:56:49 2008
New Revision: 661891

URL: http://svn.apache.org/viewvc?rev=661891&view=rev
Log:
WSCOMMONS-354
Contributor:Rich Scheuerle
Discovered By: Mark Welesko & Jay Witherspoon
Respect semicolon as a continue character when parsing HTTP headers

Modified:
    
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/PartFactory.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/attachments/AttachmentsTest.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-tests/test-resources/mtom/MTOMAttachmentStream.bin

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/PartFactory.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/PartFactory.java?rev=661891&r1=661890&r2=661891&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/PartFactory.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/impl/PartFactory.java
 Fri May 30 14:56:49 2008
@@ -232,9 +232,14 @@
                             done = true;
                         } 
                     } else {
-                        // now parse and add the header String
-                        readHeader(sb, headers);
-                        sb.delete(0, sb.length()); // Clear the buffer for 
reuse
+                        
+                        // Semicolon is a continuation character
+                        String check = headers.toString().trim();
+                        if (!check.endsWith(";")) {
+                            // now parse and add the header String
+                            readHeader(sb, headers);
+                            sb.delete(0, sb.length()); // Clear the buffer for 
reuse
+                        }
                         sb.append((char) ch);
                     }
                 } else {

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/attachments/AttachmentsTest.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/attachments/AttachmentsTest.java?rev=661891&r1=661890&r2=661891&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/attachments/AttachmentsTest.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/attachments/AttachmentsTest.java
 Fri May 30 14:56:49 2008
@@ -77,8 +77,10 @@
 
         // These should NOT throw error even though they are using part based 
access
         try {
-            assertEquals("application/xop+xml; charset=UTF-8; 
type=\"application/soap+xml\";",
-                         attachments.getSOAPPartContentType());
+            String contentType = attachments.getSOAPPartContentType();
+            assertTrue(contentType.indexOf("application/xop+xml;") >=0);
+            assertTrue(contentType.indexOf("charset=UTF-8;") >=0);
+            assertTrue(contentType.indexOf("type=\"application/soap+xml\";") 
>=0);
         } catch (IllegalStateException ise) {
             fail("No exception expected when requesting SOAP part data");
             ise.printStackTrace();

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-tests/test-resources/mtom/MTOMAttachmentStream.bin
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/test-resources/mtom/MTOMAttachmentStream.bin?rev=661891&r1=661890&r2=661891&view=diff
==============================================================================
Binary files - no diff available.


Reply via email to