From d829fbcf739d1bafe317e1849f9785bd8314f888 Mon Sep 17 00:00:00 2001 From: David Sterry Date: Mon, 13 Sep 2021 15:36:51 -0700 Subject: [PATCH] add timeout on post request --- federation/hostmeta/fetchers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/federation/hostmeta/fetchers.py b/federation/hostmeta/fetchers.py index 538f4e29..db19256d 100644 --- a/federation/hostmeta/fetchers.py +++ b/federation/hostmeta/fetchers.py @@ -35,7 +35,7 @@ def fetch_matrix_document(host: str) -> Optional[Dict]: def fetch_misskey_document(host: str, mastodon_document: Dict=None) -> Optional[Dict]: try: - response = requests.post(f'https://{host}/api/meta') # ¯\_(ツ)_/¯ + response = requests.post(f'https://{host}/api/meta', timeout=2) # ¯\_(ツ)_/¯ except Exception: return try: