Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002454 [Squeak] Network major always 01-08-06 19:36 05-29-06 21:53
Reporter tb View Status public  
Assigned To tb
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 3.9 Product Version 3.8
  Product Build
Summary 0002454: HttpUrl>>retrieveContents does not use correct mime type
Description Trying to retrieve a css file from an IIS server will fail if you did something like "http://someserver.com/file.css" [^] because the ACCEPT header is not being set to text/css.

There is a mime-file extensions database already in the image, we should use it specify ACCEPT headers properly. Thus,

HttpUrl>>retrieveContentsArgs: args

    ^self retrieveContentsArgs: args accept: 'application/octet-stream'

should be changed to:

HttpUrl>>retrieveContentsArgs: args

    ^self retrieveContentsArgs: args accept: (MIMEDocument guessTypeFromName: self)
Steps To Reproduce
Additional Information
Attached Files  HttpUrl_RetriveContentsFix.1.cs [^] (270 bytes) 01-20-06 07:05
 HttpUrl_RetriveContentsFix.2.cs [^] (240 bytes) 05-01-06 14:18

- Relationships

- Notes
(0003575 - 18 - 18 - 18 - 18 - 18 - 18)
tb
01-20-06 07:06

Changeset attached
 
(0004837 - 671 - 730 - 1168 - 1168 - 1168 - 1168)
Etan Wexler
05-01-06 14:17

Guessing the Internet media type (MIME type, Content-Type) is very poor practice. Consult section 2.5, “URI Opacity”, of “Architecture of the World Wide Web, Volume One” ( http://www.w3.org/TR/webarch/#uri-opacity [^] ).

The right thing is to accept any Internet media type. Consult section 14.1, “Accept” ( http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1 [^] ), of the specification “Hypertext Transfer Protocol -- HTTP/1.1” (RFC 2616, http://www.rfc-editor.org/rfc/rfc2616.txt [^] ). I recommend an explicit header field:

Accept: */*; q=1

The Smalltalk would be as follows:

retrieveContentsArgs: args
 ^self retrieveContentsArgs: args accept: '*/*; q=1'
 
(0004844 - 57 - 69 - 69 - 69 - 69 - 69)
ducasse
05-02-06 20:57

I hope that the IO team will harvest this change.

Stef
 
(0005053 - 68 - 68 - 228 - 228 - 228 - 228)
tb
05-25-06 06:21

Harvested as http://source.squeakfoundation.org/IO/Network-tb.28.mcz [^]
 
(0005094 - 7 - 7 - 7 - 7 - 7 - 7)
ducasse
05-29-06 21:53

in 7033
 

- Issue History
Date Modified Username Field Change
01-08-06 19:36 tb New Issue
01-08-06 19:48 tb Issue Monitored: tb
01-08-06 23:41 pmm Issue Monitored: pmm
01-20-06 07:05 tb File Added: HttpUrl_RetriveContentsFix.1.cs
01-20-06 07:06 tb Note Added: 0003575
05-01-06 14:17 Etan Wexler Note Added: 0004837
05-01-06 14:18 Etan Wexler File Added: HttpUrl_RetriveContentsFix.2.cs
05-01-06 14:19 Etan Wexler Issue Monitored: Etan Wexler
05-02-06 20:57 ducasse Note Added: 0004844
05-25-06 05:58 tb Status new => assigned
05-25-06 05:58 tb Assigned To  => tb
05-25-06 06:21 tb Note Added: 0005053
05-25-06 06:23 tb Status assigned => resolved
05-25-06 06:23 tb Fixed in Version  => 3.9
05-25-06 06:23 tb Resolution open => fixed
05-25-06 06:23 tb Note Added: 0005054
05-25-06 06:27 KenCausey Note Deleted: 0005054
05-29-06 21:53 ducasse Status resolved => closed
05-29-06 21:53 ducasse Note Added: 0005094


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