avoid NPE if there are no headers in the request
remove redirection as it uses wrong scheme behind a proxy