avoid sending HTTP headers before requesting HTTP redirect