Fix calling wrong path

This commit is contained in:
OmarHatem 2023-03-02 21:13:19 +02:00
parent 29e9bb2181
commit 60f47e5e9f

View file

@ -290,22 +290,23 @@ class TrocadorExchangeProvider extends ExchangeProvider {
}
}
Future<Uri> _getUri(String createTradePath, Map<String, String> queryParams) async {
Future<Uri> _getUri(String path, Map<String, String> queryParams) async {
if (!supportsOnionAddress) {
return Uri.https(clearNetAuthority, tradePath, queryParams);
return Uri.https(clearNetAuthority, path, queryParams);
}
final uri = Uri.http(onionApiAuthority, path, queryParams);
if (useTorOnly) {
return Uri.http(onionApiAuthority, tradePath, queryParams);
return uri;
}
try {
final uri = Uri.http(onionApiAuthority, tradePath);
await get(uri);
return Uri.http(onionApiAuthority, tradePath, queryParams);
return uri;
} catch (e) {
return Uri.https(clearNetAuthority, tradePath, queryParams);
return Uri.https(clearNetAuthority, path, queryParams);
}
}
}