authentik/passbook/lib/utils/urls.py

8 lines
213 B
Python
Raw Normal View History

2018-11-14 18:14:14 +00:00
"""URL-related utils"""
from urllib.parse import urlparse
def is_url_absolute(url):
"""Check if domain is absolute to prevent user from being redirect somewhere else"""
return bool(urlparse(url).netloc)