This repository was archived by the owner on Feb 20, 2020. It is now read-only.
File tree 3 files changed +19
-1
lines changed
main/java/javax/mail/internet
test/java/javax/mail/internet
3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ GH 317 use System.lineSeparator() instead of System.getProperty(...)
30
30
GH 321 URLName.getURL() returns incorrect url.
31
31
GH 322 Dots in local part of emails not handled properly
32
32
GH 323 Support loading protocol providers using ServiceLoader
33
+ GH 326 Apply relaxed Content-Disposition parsing to Content-Disposition parameters
33
34
34
35
35
36
CHANGES IN THE 1.6.1 RELEASE
Original file line number Diff line number Diff line change @@ -105,7 +105,14 @@ public ContentDisposition(String s) throws ParseException {
105
105
// Then parameters ..
106
106
String rem = h .getRemainder ();
107
107
if (rem != null )
108
- list = new ParameterList (rem );
108
+ try {
109
+ list = new ParameterList (rem );
110
+ } catch (ParseException px ) {
111
+ if (contentDispositionStrict ) {
112
+ throw px ;
113
+ }
114
+ }
115
+ }
109
116
}
110
117
111
118
/**
Original file line number Diff line number Diff line change @@ -64,6 +64,16 @@ public void testDecode() throws Exception {
64
64
}
65
65
}
66
66
67
+ @ Test
68
+ public void testDecodeWithParams () throws Exception {
69
+ try {
70
+ ContentDisposition cd = new ContentDisposition (" ; size=12345" );
71
+ assertNull ("Content disposition must parse to null in non-strict mode" , cd .getDisposition ());
72
+ } catch (ParseException px ) {
73
+ fail ("Exception must not be thrown in non-strict mode" );
74
+ }
75
+ }
76
+
67
77
@ AfterClass
68
78
public static void after () {
69
79
System .clearProperty ("mail.mime.contentdisposition.strict" );
You can’t perform that action at this time.
0 commit comments