Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A oneliner for testing redirects
# The following line defines a bash function and is designed to be copy-pasta-ed into your terminal and used as shown on the last line of this file. I'm only putting it in a script to get it on gist
redir_test(){ curl -svLo /tmp/redir_test.out "$@" 2>&1 | grep -E '^(> Host|> GET|< HTTP|< location|[<>]\s*$)'; }
# BONUS: One super-useful use of this is to test your readiness to respond to future DNS changes. That can be done like so:
# redir_test -H 'Host:'
# This assumes that your server at is set up to serve and this simulates what `curl` would do if DNS returned when doing a lookup on
redir_test "$@"
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.