Christoph Thiede uploaded a new version of Network to project The Trunk: http://source.squeak.org/trunk/Network-ct.268.mcz
==================== Summary ====================
Name: Network-ct.268 Author: ct Time: 19 May 2023, 1:40:42.341195 pm UUID: 63ac44a4-d515-6742-bc5e-00724d671c09 Ancestors: Network-tpr.267
Fixes parsing of multipart documents. As per RFC1341, the final separator can - or even should - be extended by two dashes. Note that we do not properly ignore preamble and epilogue for now, simply because of lack of need.
=============== Diff against Network-tpr.267 ===============
Item was changed: ----- Method: MIMEDocument class>>parseParts:withSeparator: (in category 'instance creation') ----- parseParts: bodyText withSeparator: separator "private -- parse the parts of the message and store them into a collection"
| parseStream msgStream messages normalizedSeparator | parseStream := ReadStream on: bodyText. msgStream := LimitingLineStreamWrapper on: parseStream delimiter: separator. normalizedSeparator := separator asLowercase. msgStream limitingBlock: [:aLine | | normalizedLine | normalizedLine := aLine withoutTrailingBlanks asLowercase. normalizedLine = normalizedSeparator or: "Match the separator" + [normalizedLine = ('--',normalizedSeparator)] or: "or the separator after --" + [normalizedLine = (normalizedSeparator, '--')] or: "or the final separator before --" + [normalizedLine = ('--',normalizedSeparator, '--')]]. "or the final separator before and after --" - [normalizedLine = ('--',normalizedSeparator)] or: "or -- and the separator" - [normalizedLine = (normalizedSeparator, '--')]]. "or the final separator with --"
"Throw away everything up to and including the first separator" msgStream upToEnd. msgStream skipThisLine.
"Extract each of the multi-parts as strings" messages := OrderedCollection new. [parseStream atEnd] whileFalse: [messages add: msgStream upToEnd. msgStream skipThisLine].
^ messages collect: [:e | MIMEDocument fromPartString: e]!
packages@lists.squeakfoundation.org