Use -L for curl due to curl not following redirect by default