[BUGFIX] Keep current protocol on redirects

If the current request was performed via HTTPS, a redirect should not change the protocol to HTTP.