Mantis Bugtracker

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005507 [Squeak] Network major always 11-24-06 22:57 11-24-06 22:57
Reporter matthias_berth View Status public  
Assigned To cdegroot
Priority normal Resolution open Platform
Status assigned   OS
Projection none   OS Version
ETA none Fixed in Version Product Version 3.9
  Product Build
Summary 0005507: [BUG][FIX] HttpResponse>>fromMIMEDocument: does not work when MIME document contents is not a String
Description Try to make a HttpResponse from a MIMEDocument that contains binary data, e.g. an image, as in

doc := form asMIMEDocument.
^ HttpResponse fromMIMEDocument: doc

Returning that response will fail with ByteArray does not understand #atEnd.

The critical method is

HttpResponse>>fromMIMEDocument: aMIMEDoc
    | content |
    content := aMIMEDoc content.
    content isString
        ifTrue: [content := ReadStream on: content].
    ^ self basicNew status: #ok;
         contentType: aMIMEDoc mimeType;
         contents: aMIMEDoc content;
         yourself"fieldAt: 'Cache-Control' put: 'max-age=86400';"

The next to last line should be

         contents: aMIMEDoc contentStream;

Change set attached below.
Steps To Reproduce
Additional Information
Attached Files  HttpResponse_fromMIMEDocument_fix.1.cs [^] (699 bytes) 11-24-06 22:57

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
11-24-06 22:57 matthias_berth New Issue
11-24-06 22:57 matthias_berth Status new => assigned
11-24-06 22:57 matthias_berth Assigned To  => cdegroot
11-24-06 22:57 matthias_berth File Added: HttpResponse_fromMIMEDocument_fix.1.cs

Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
32 total queries executed.
27 unique queries executed.
Powered by Mantis Bugtracker