mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 19:51:54 +02:00
Ensure timeout in requests
This commit is contained in:
parent
b8c7e960c3
commit
206ae296b6
4 changed files with 5 additions and 1 deletions
|
@ -31,6 +31,7 @@ def remove_tags(text):
|
|||
def get_actor_data(actor_url):
|
||||
response = session.get_session().get(
|
||||
actor_url,
|
||||
timeout=5,
|
||||
headers={
|
||||
'Accept': 'application/activity+json',
|
||||
}
|
||||
|
@ -42,6 +43,7 @@ def get_actor_data(actor_url):
|
|||
raise ValueError(
|
||||
'Invalid actor payload: {}'.format(response.text))
|
||||
|
||||
|
||||
def get_actor(actor_url):
|
||||
data = get_actor_data(actor_url)
|
||||
serializer = serializers.ActorSerializer(data=data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue