Python - URL Redirection - Harder
Last updated
Was this helpful?
Was this helpful?
GET /redirect?newurl=newsitelanding_page = request.args.get('newurl')
if blacklist(landing_page):
return render_template("index.html", content = "Sorry, you cannot use \".\" in the redirect")
return redirect(landing_page, 302)def blacklist(url):
blacklist = ["."]
for b in blacklist:
if url.find(b) != -1:
return True
return Falsehttps://www%252egoogle%252ecom