Skip to content

Commit

Permalink
Merge pull request #269 from johngian/fix-pr-264
Browse files Browse the repository at this point in the history
Fixes #261 - Cleans up legacy code
  • Loading branch information
johngian committed Aug 9, 2018
2 parents eceaff7 + d3eae79 commit be2eb1e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mozilla_django_oidc/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,16 @@ def get_next_url(request, redirect_field_name):
if next_url:
kwargs = {
'url': next_url,
'require_https': request.is_secure()
}
# NOTE(willkg): Django 1.11+ allows us to require https, too.
if django.VERSION >= (1, 11):
kwargs['require_https'] = request.is_secure()

# NOTE(robhudson): Django 2.1 changes `host` to `allowed_hosts`.
host = request.get_host()
if django.VERSION >= (2, 1):
kwargs['allowed_hosts'] = host
else:
kwargs['host'] = host

is_safe = is_safe_url(**kwargs)
if is_safe:
return next_url
Expand Down

0 comments on commit be2eb1e

Please sign in to comment.