From 485f2cbbfad73f29e8f567684e4a47ef30cf9eff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A3t=C3=A3lin=20Mari=C5=9F?= Date: Fri, 10 May 2013 09:21:21 +0200 Subject: .functions: Improve `httpcompression` and move it to its own file Closes #162. --- .functions | 6 ------ 1 file changed, 6 deletions(-) (limited to '.functions') diff --git a/.functions b/.functions index 5a2788b..418852e 100644 --- a/.functions +++ b/.functions @@ -112,12 +112,6 @@ function gz() { printf "gzip: %d bytes (%2.2f%%)\n" "$gzipsize" "$ratio" } -# Test if HTTP compression (RFC 2616 + SDCH) is enabled for a given URL. -# Send a fake UA string for sites that sniff it instead of using the Accept-Encoding header. (Looking at you, ajax.googleapis.com!) -function httpcompression() { - local encoding="$(curl -LIs -H 'User-Agent: Mozilla/5 Gecko' -H 'Accept-Encoding: gzip,deflate,compress,sdch' "$1" | grep '^Content-Encoding:')" && echo "$1 is encoded using ${encoding#* }" || echo "$1 is not using any encoding" -} - # Syntax-highlight JSON strings or files # Usage: `json '{"foo":42}'` or `echo '{"foo":42}' | json` function json() { -- cgit v1.2.3