Add debug= parameter to webfinger

pull/14/head
Dashie 2018-08-14 21:54:46 +02:00
rodzic 9943e2b047
commit 75b6b9d833
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: C2D57B325840B755
1 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -13,7 +13,9 @@ from .urlutils import check_url
logger = logging.getLogger(__name__)
def webfinger(resource: str) -> Optional[Dict[str, Any]]: # noqa: C901
def webfinger(
resource: str, debug: bool = False
) -> Optional[Dict[str, Any]]: # noqa: C901
"""Mastodon-like WebFinger resolution to retrieve the activity stream Actor URL.
"""
logger.info(f"performing webfinger resolution for {resource}")
@ -32,7 +34,7 @@ def webfinger(resource: str) -> Optional[Dict[str, Any]]: # noqa: C901
resource = "acct:" + resource
# Security check on the url (like not calling localhost)
check_url(f"https://{host}")
check_url(f"https://{host}", debug=debug)
is_404 = False
for i, proto in enumerate(protos):