Skip to content

fix the usage of URL #1311

@WayneLaw-Crypto

Description

@WayneLaw-Crypto

const url = new URL(baseUrl + (path ?? ""));

const response = await fetch(new URL(baseUrl + path).toString(), {

There will have some issue in react native env of new URL usage.

for example:
const url1 = new URL('https://api.skip.build' + '/v2/info/balances');
console.log(url1.toString())
the output would be https://api.skip.build/v2/info/balances/

const url2 = new URL('/v2/info/balances', 'https://api.skip.build');
logLog('url2 = ', url2.toString());
the output would be https://api.skip.build/v2/info/balances

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions