Prevents an invalid redirect from being performed via a malformed request

If the redirect function is called with a request such as http://www.example.com//www.someotherwebsite.com, the client receives a Location header of //www.someotherwebsite.com, causing it to perform a redirect to the specified domain.

Additionally, inspecting for a uri prefix of '/' prevents the possibility of introducing other malicious redirect requests.