-
-
Save brianjlandau/e53bc4b9608680d0cb33b2f40f26c47c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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