Skip to content

Commit a6f55ce

Browse files
committed
Fix the regex for calendar parsing
Sometimes, so far only seen on Google Calendar invites, the content type for text/calendar doesn't include double quotes ("), like so: Content-Type: text/calendar; charset=UTF-8; method=CANCEL This fix makes the matching " optional.
1 parent d989381 commit a6f55ce

File tree

1 file changed

+1
-1
lines changed
  • modules/simple-java-mail/src/main/java/org/simplejavamail/converter/internal/mimemessage

1 file changed

+1
-1
lines changed

modules/simple-java-mail/src/main/java/org/simplejavamail/converter/internal/mimemessage/MimeMessageParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public static String parseFileName(@NotNull final Part currentPart) {
208208
*/
209209
@SuppressWarnings("WeakerAccess")
210210
public static String parseCalendarMethod(@NotNull MimePart currentPart) {
211-
Pattern compile = Pattern.compile("method=\"(.*?)\"");
211+
Pattern compile = Pattern.compile("method=\"?(\\w+)");
212212
final String contentType;
213213
try {
214214
contentType = currentPart.getDataHandler().getContentType();

0 commit comments

Comments
 (0)