Overview
| Artifact ID: | 3c2dee93b16f1769e4da2b166f351bf38c7282cc |
|---|---|
| Ticket: | 219399ffffffffffffffffffffffffffffffffff
Incoming text encoded gzip not being read in binary mode |
| User & Date: | nobody on 2000-10-26 05:12:26 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
OriginalBugID: 6255 Bug Version: 8.3 SubmitDate: '2000-09-12' LastModified: '2000-10-25' Severity: CRIT Status: UnAssn Submitter: techsupp OS: Solaris OSVersion: Solaris 8 Machine: Ultra 1 FixedDate: '2000-10-25' ClosedDate: '2000-10-25' Name: George Orwell Extensions: none CustomShell: none Comments: I'm using a fairly recent release: tclsh % package require http 2.2 Incoming gzip is totally failing because <CR>s are turning into <NL>s. ReproducibleScript: package require http set headers [list Accept "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*" \ Accept-Encoding gzip \ Accept-Language en \ Accept-Charset "iso-8859-1,*,utf-8" ] set token [http::geturl http://www.netaddress.com/ -headers $headers] upvar #0 $token state set fd [open temp.body.gz w] fconfigure $fd -translation binary puts -nonewline $fd $state(body) close $fd ObservedBehavior: Incoming HTTP says text/html encoded gzip. # HTTP: HTTP/1.1 200 OK # HTTP: Date: Mon, 11 Sep 2000 16:07:40 GMT # HTTP: Server: Apache/1.2.5 # HTTP: Content-Length: 2518 # HTTP: Content-encoding: gzip # HTTP: Keep-Alive: timeout=1, max=99 # HTTP: Connection: Keep-Alive # HTTP: Content-Type: text/html In the http package (package require http), there appears to be an error: if {![regexp -nocase ^text $state(type)]} { # Turn off conversions for non-text data fconfigure $s -translation binary This is not being triggered, because $state(type) is 'text/html'. DesiredBehavior: It is not picking up on the text/html being encoded: $state(meta) ...Content-encoding gzip... Patch: This crude edit means I can now gunzip the data without failing due to a CRC error: if {![regexp -nocase ^text $state(type)] \ || [regexp -nocase gzip $state(meta)]} { PatchFiles: package require http - foundin changed to: "obsolete: 8.3"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "69. Other"
- title changed to:
Incoming text encoded gzip not being read in binary mode
- type changed to: "Bug"