diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-10-12 02:22:57 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2013-10-12 02:22:57 +0200 |
commit | ab7fe19ae264aa569f6298b73492d4b3e733e0b0 (patch) | |
tree | fd1f2f21124746441d4f16f2ed06375d3c185488 | |
parent | 0460e4be7d85168f52cf9f03a98448b6575fdc2b (diff) | |
download | plan9front-ab7fe19ae264aa569f6298b73492d4b3e733e0b0.tar.xz |
hget: handle http contentencoding (compression)
-rwxr-xr-x | rc/bin/hget | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/rc/bin/hget b/rc/bin/hget index bb50a899b..82b9cba67 100755 --- a/rc/bin/hget +++ b/rc/bin/hget @@ -81,6 +81,15 @@ if(! ~ $s 0) exec cat >>$o exec cat >$o } + c=`{cat $d/contentencoding >[2]/dev/null} + switch($c){ + case *gzip* + exec gunzip + case *bzip2* + exec bunzip2 + case *compress* + exec uncompress + } exec cat } } |