mirror of
https://github.com/github/codeql.git
synced 2026-05-02 20:25:13 +02:00
Python: Fix false positive in 'Incomplete URL substring sanitization' query.
This commit is contained in:
@@ -39,3 +39,12 @@ def safe2(request):
|
||||
if host and host.endswith(".example.com"):
|
||||
return redirect(target)
|
||||
|
||||
|
||||
@app.route('/some/path/good3')
|
||||
def safe3(request):
|
||||
target = request.args.get('target', '')
|
||||
target = urlparse(target)
|
||||
#Start url with https:// and ends with a / so must match the correct domain.
|
||||
if target and target.startswith("https://example.com/"):
|
||||
return redirect(target)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user