Skip to content

Commit fc8ce81

Browse files
authored
chore: refine allbridge header (#789)
Setting an allbridge request header similar to the official SDK in an attempt to get rid of the 403 response Context: https://valora-app.slack.com/archives/C02N3AR2P2S/p1740482746542719
1 parent 07eed61 commit fc8ce81

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/apps/allbridge/api.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ export async function getAllbridgeTokenInfo({
9898
) as AllbridgeApiResponse
9999
if (!allbridgeTokensInfoResponse) {
100100
allbridgeTokensInfoResponse = await got
101-
.get('https://core.api.allbridgecoreapi.net/token-info')
101+
.get('https://core.api.allbridgecoreapi.net/token-info', {
102+
headers: {
103+
'x-Sdk-Agent': 'AllbridgeCoreSDK/3.21.0', // as in https://github.com/allbridge-io/allbridge-core-js-sdk/blob/5deb0623d6fffcbc7a85dba22b98942c47d4af6c/src/client/core-api/api-client.ts#L48
104+
},
105+
})
102106
.json()
103107
cache.set(TOKEN_INFO_RESPONSE_KEY, allbridgeTokensInfoResponse)
104108
}

0 commit comments

Comments
 (0)