Skip to content

Instantly share code, notes, and snippets.

@brianjlandau

brianjlandau/check-gzip

Forked from reagent/check-gzip
Last active Jul 14, 2016
Embed
What would you like to do?
#!/usr/bin/env bash
if [ ${#1} -eq 0 ]
then echo "Error: Please supply a URL"; exit 1;
fi
ENCODING_HEADER=$(curl --silent -I $1 -H "Accept-Encoding: gzip,deflate" | tr -d '\r' | sed -En 's/^Content-Encoding: (.+)$/\1/p')
if [ "$ENCODING_HEADER" == "gzip" ]
then echo "GZIP: Enabled"
else echo "GZIP: Disabled"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.