Skip to content

Commit

Permalink
Merge branch 'main' into issue-OWASP-BLT#1346
Browse files Browse the repository at this point in the history
  • Loading branch information
DonnieBLT authored Oct 28, 2023
2 parents d3df289 + de6d695 commit 594c40e
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 594c40e

Please sign in to comment.