Added checks on the protocol of redirected URLs