<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>Hi Levente,</p>
<p><br>
</p>
<p>thanks for the feedback. We already have WebClientServerTest >> #<span>testMultipartFiles but it already passed before this patch because the decoding implementation in WebUtils (#<span>decodeMultipartForm:boundary:do:) is very robust: Instead of parsing
 a specific header syntax, it just searches for patterns matching #=, just see yourself ...</span></span></p>
<p><span><span><br>
</span></span></p>
<p><span><span>I did not want to touch this because I thought robust client/server implementations are a good thing in general (at least every web browser is able to display malformed HTML pages), but this hinders us from writing simple integration tests. Would
 you recommend to sharpen the decoding implementation or rather to write separate unit tests? :-)</span></span></p>
<p><span><span><br>
</span></span></p>
<p><span><span>Best,</span></span></p>
<p><span><span>Christoph</span></span></p>
<div id="x_Signature">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="x_divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">
<div class="x__rp_U4 x_ms-font-weight-regular x_ms-font-color-neutralDark x_rpHighlightAllClass x_rpHighlightBodyClass" id="x_Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="x_divtagdefaultwrapper"><font face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="x_Signature">
<div style="margin:0px"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont">
<div><font size="3" color="black"><span style="font-size:12pt"><a href="http://www.hpi.de/" target="_blank" rel="noopener noreferrer" id="LPNoLP"><font size="2"><span id="LPlnk909538"><font color="#757B80"></font></span></font></a></span></font></div>
</font></div>
</div>
</font></div>
</div>
</div>
</div>
</div>
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Levente Uzonyi <leves@caesar.elte.hu><br>
<b>Gesendet:</b> Dienstag, 1. September 2020 16:18:53<br>
<b>An:</b> ma.chris.m@gmail.com; The general-purpose Squeak developers list<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: WebClient-Core-ct.124.mcz</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">The change looks good to me. It would be better if we had a test case
<br>
covering this method.<br>
<br>
<br>
Levente<br>
<br>
On Mon, 31 Aug 2020, Chris Muller wrote:<br>
<br>
> I'm not qualified to review the change but good dig!   :)<br>
><br>
> On Sun, Aug 30, 2020 at 6:54 PM <commits@source.squeak.org> wrote:<br>
>><br>
>> Christoph Thiede uploaded a new version of WebClient-Core to project The Inbox:<br>
>> <a href="http://source.squeak.org/inbox/WebClient-Core-ct.124.mcz">http://source.squeak.org/inbox/WebClient-Core-ct.124.mcz</a><br>
>><br>
>> ==================== Summary ====================<br>
>><br>
>> Name: WebClient-Core-ct.124<br>
>> Author: ct<br>
>> Time: 31 August 2020, 1:54:11.685896 am<br>
>> UUID: b0d7790c-c195-6e4d-ad0f-fce8cf8b3b00<br>
>> Ancestors: WebClient-Core-ul.123<br>
>><br>
>> Fixes a syntax error in multipart/form-data encoding<br>
>><br>
>> Phew! It costed me a few hours to track some higher-level application bug down to this low level code ...<br>
>><br>
>> =============== Diff against WebClient-Core-ul.123 ===============<br>
>><br>
>> Item was changed:<br>
>>   ----- Method: WebUtils class>>encodeMultipartForm:boundary: (in category 'decoding') -----<br>
>>   encodeMultipartForm: fieldMap boundary: boundary<br>
>>         "Encodes the fieldMap as multipart/form-data.<br>
>><br>
>>         The fieldMap may contain MIMEDocument instances to indicate the presence<br>
>>         of a file to upload to the server. If the MIMEDocument is present, its<br>
>>         content type and file name will be used for the upload.<br>
>><br>
>>         The fieldMap can be EITHER an array of associations OR a Dictionary of<br>
>>         key value pairs (the former is useful for providing multiple fields and/or<br>
>>         specifying the order of fields)."<br>
>><br>
>>         ^String streamContents:[:stream|<br>
>>                 (fieldMap as: Dictionary) keysAndValuesDo:[:fieldName :fieldValue | | fieldContent |<br>
>>                         "Write multipart boundary and common headers"<br>
>>                         stream nextPutAll: '--', boundary; crlf.<br>
>>                         stream nextPutAll: 'Content-Disposition: form-data; name="', fieldName, '"'.<br>
>>                         "Figure out if this is a file upload"<br>
>>                         (fieldValue isKindOf: MIMEDocument) ifTrue:[<br>
>> +                               stream nextPutAll: '; filename="', fieldValue url pathForFile, '"'; crlf.<br>
>> -                               stream nextPutAll: ' filename="', fieldValue url pathForFile, '"'; crlf.<br>
>>                                 stream nextPutAll: 'Content-Type: ', fieldValue contentType.<br>
>>                                 fieldContent := (fieldValue content ifNil:[<br>
>>                                         (FileStream readOnlyFileNamed: fieldValue url pathForFile) contentsOfEntireFile.<br>
>>                                 ]) asString.<br>
>>                         ] ifFalse: [fieldContent := fieldValue].<br>
>>                         stream crlf; crlf.<br>
>>                         stream nextPutAll: fieldContent asString.<br>
>>                         stream crlf.<br>
>>                 ].<br>
>>                 stream nextPutAll: '--', boundary, '--', String crlf.<br>
>>         ].<br>
>>   !<br>
>><br>
>><br>
<br>
</div>
</span></font>
</body>
</html>