summaryrefslogtreecommitdiffstats
path: root/ds9/library/htp.tcl
blob: c623ea66dd690173bdfc6ba01e0c34aff9a2f563 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package provide DS9 1.0
namespace eval ::http {}

# Needed because some sites return 'x-fits' (CADC) in Content-Encoding
proc http::ContentEncoding {token} {
    upvar 0 $token state
    set r {}
    if {[info exists state(coding)]} {
	foreach coding [split $state(coding) ,] {
	    switch -exact -- $coding {
		deflate { lappend r inflate }
		gzip - x-gzip { lappend r gunzip }
		compress - x-compress { lappend r decompress }
		identity {}
		x-fits {}
		default {
# just do nothing
# return -code error "unsupported content-encoding \"$coding\""
		}
	    }
	}
    }
    return $r
}