stop retries after wrong content-type
It does not make sense to re-request the same resource with the same parameters and expect a different content-type to be returned. Also this makes the error message more sensible and understandable.
This commit is contained in:
parent
4b3154c22c
commit
fba8536743
1 changed files with 3 additions and 2 deletions
|
@ -121,9 +121,10 @@ export async function signedGet(_url: string, user: { id: User['id'] }): Promise
|
|||
return false;
|
||||
};
|
||||
|
||||
if (isActivitypub(res.headers.get('Content-Type'))) {
|
||||
return await res.json();
|
||||
if (!isActivitypub(res.headers.get('Content-Type'))) {
|
||||
throw new Error('invalid response content type');
|
||||
}
|
||||
return await res.json();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue