    def test_open_redirect(self):
        bad_urls = [
            "/",
            "//",
            "~/",
            "//example.com",
            "/\example.com"
            "~/example.com"
            "//example.com/a/b/c",
            "//example.com/a/b/c",
            "~/example.com/a/b/c"
        ]
        good_urls = [
            "a/b/c",
            "/a",
            "/a/b",
            "/a/b/c",
        ]
        prefixes = ["", ":", "http:", "https:", "ftp:"]
        for prefix in prefixes:
            for url in bad_urls:
                self.assertEqual(prevent_open_redirect(prefix + url), None)
        for prefix in prefixes:
            for url in good_urls:
                self.assertEqual(prevent_open_redirect(prefix + url), prefix + url)
A web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a Redirect. This simplifies phishing attacks.