Skip to content

Commit

Permalink
Fix code scanning alert issue-#1338 (#1502)
Browse files Browse the repository at this point in the history
Co-authored-by: DonnieBLT <128622481+DonnieBLT@users.noreply.github.com>
  • Loading branch information
JisanAR03 and DonnieBLT authored Oct 28, 2023
1 parent f869d90 commit de6d695
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion website/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,12 @@ def index(request, template="index.html"):


def github_callback(request):
ALLOWED_HOSTS = ['github.com']
params = urllib.parse.urlencode(request.GET)
return redirect(f"{settings.CALLBACK_URL_FOR_GITHUB}?{params}")
url = f"{settings.CALLBACK_URL_FOR_GITHUB}?{params}"
parsed_url = urlparse(url)
if parsed_url.netloc in ALLOWED_HOSTS:
return redirect(url)


def google_callback(request):
Expand Down

0 comments on commit de6d695

Please sign in to comment.