mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-16 03:40:37 +08:00
Avoid 301 redirect when getting safes
Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
+2
-2
@@ -292,7 +292,7 @@ export async function isSafe(address: string, config: Config): Promise<boolean>
|
||||
if (! config.safe.api) return false;
|
||||
|
||||
const addr = ethers.utils.getAddress(address);
|
||||
const response = await fetch(`${config.safe.api}/api/v1/safes/${addr}`, { method: 'HEAD' });
|
||||
const response = await fetch(`${config.safe.api}/api/v1/safes/${addr}/`, { method: 'HEAD' });
|
||||
|
||||
return response.ok;
|
||||
}
|
||||
@@ -302,7 +302,7 @@ export async function getSafe(address: string, config: Config): Promise<Safe | n
|
||||
if (! config.safe.api) return null;
|
||||
|
||||
const addr = ethers.utils.getAddress(address);
|
||||
const response = await fetch(`${config.safe.api}/api/v1/safes/${addr}`, {
|
||||
const response = await fetch(`${config.safe.api}/api/v1/safes/${addr}/`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
|
||||
Reference in New Issue
Block a user