Skip to content

Commit

Permalink
Fixed how token subject is constructed. Fixed remote URL with the pro…
Browse files Browse the repository at this point in the history
…xy. Fixed fetcher to read properties securely
  • Loading branch information
vsubhuman committed Jun 14, 2021
1 parent 10ec406 commit 2f56c16
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Expand Up @@ -371,17 +371,17 @@ export class RemoteFetcher implements IFetcher {
}

getTokenInfo: TokenInfoRequest => Promise<TokenInfoResponse> = async (body) => {
const { TokenInfoService } = body.network.Backend;
const { TokenInfoService } = body?.network?.Backend;
if (TokenInfoService == null) return {};
const promises = body.tokenIds.map(id => axios(
`${TokenInfoService}/metadata/${id}`,
{
method: 'get',
timeout: 2 * CONFIG.app.walletRefreshInterval,
// headers: {
// 'yoroi-version': this.getLastLaunchVersion(),
// 'yoroi-locale': this.getCurrentLocale()
// }
headers: {
'yoroi-version': this.getLastLaunchVersion(),
'yoroi-locale': this.getCurrentLocale()
}
}
).then(response => response.data)
.catch((error) => {
Expand Down
Expand Up @@ -34,7 +34,7 @@ export const networks = Object.freeze({
? 'ws://localhost:21000'
: 'wss://iohk-mainnet.yoroiwallet.com:443',
TokenInfoService:
'https://tokens.cardano.org',
'https://cdn.yoroiwallet.com',
},
BaseConfig: ([
Object.freeze({
Expand Down
Expand Up @@ -43,7 +43,7 @@ export default class AdaTransactionsStore extends Store<StoresMap, ActionsMap> {
const missingMetaTokenIds = [...tokenIds]
.filter(tokenId => tokenId.length > 0
&& !localStorage.getItem(createTokenLocalStorageKey(tokenId, network)))
.map(id => id.split('.')[0]);
.map(id => id.split('.').join(''));
const tokenInfo = await stateFetcher.getTokenInfo({
network,
tokenIds: missingMetaTokenIds,
Expand Down

0 comments on commit 2f56c16

Please sign in to comment.