james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r894097 - /james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/descriptor/MaximalBodyDescriptor.java
Date Sun, 27 Dec 2009 18:57:09 GMT
Author: bago
Date: Sun Dec 27 18:57:08 2009
New Revision: 894097

URL: http://svn.apache.org/viewvc?rev=894097&view=rev
Log:
Content-Location needs a special "decoding" to remove linear whitespace after unfolding. Remove
calls to setFoldingPreserved, as "false" is also the default (only?) behaviour.

Modified:
    james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/descriptor/MaximalBodyDescriptor.java

Modified: james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/descriptor/MaximalBodyDescriptor.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/descriptor/MaximalBodyDescriptor.java?rev=894097&r1=894096&r2=894097&view=diff
==============================================================================
--- james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/descriptor/MaximalBodyDescriptor.java
(original)
+++ james/mime4j/trunk/core/src/main/java/org/apache/james/mime4j/descriptor/MaximalBodyDescriptor.java
Sun Dec 27 18:57:08 2009
@@ -140,9 +140,15 @@
         if (value != null) {
             final StringReader stringReader = new StringReader(value);
             final StructuredFieldParser parser = new StructuredFieldParser(stringReader);
-            parser.setFoldingPreserved(false);
             try {
-                contentLocation = parser.parse();
+            	// From RFC2017 3.1
+            	/*
+            	 * Extraction of the URL string from the URL-parameter is even simpler:
+            	 * The enclosing quotes and any linear whitespace are removed and the
+            	 * remaining material is the URL string.
+            	 * Read more: http://www.faqs.org/rfcs/rfc2017.html#ixzz0aufO9nRL
+            	 */
+                contentLocation = parser.parse().replaceAll("\\s", "");
             } catch (MimeException e) { 
                 contentLocationParseException = e;
             }



Mime
View raw message