Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 1d4ce8349e6f92afc5c9f545aac582bda134b732f98a03c4b8fd8befd54f7a6f
Ticket: 338d979f5be43e5d147f7a9c7d50eff9cd10917a
Image data without content type is corrupted by http package
User & Date: sbron on 2020-07-24 20:07:22
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    When a web site doesn't provide a content type, RFC 2616 specifies: "If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and/or the name extension(s) of the URI used to identify the resource. If the media type remains unknown, the recipient SHOULD treat it as type "application/octet-stream". The http package does not follow this directive and treats all data with an unknown content type as text. This is an unfortunate choice, because once converted to text (translating \r\n to \n), information has been lost that can't be recovered. Reporting text as binary data on the other hand can easily be corrected.
    
    As an example, a popular Dutch web site produces a png image without providing a content-type header: https://image.buienradar.nl/2.0/image/sprite/RadarMapRainNL. See also the attached script.
    
    The only work-around is to add the -binary option to http::geturl. But that treats any response as binary, even when a site does provide a content-type header.
    
  5. foundin changed to: "2.9.1"
  6. is_private changed to: "0"
  7. login: "sbron"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "8475f421649231f1e116ac602bea4537d2b027b4"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "sbron"
  14. subsystem changed to: "29. http Package"
  15. title changed to:
    Image data without content type is corrupted by http package
    
  16. type changed to: "Bug"