add user agent to coingecko exchange source request

This commit is contained in:
Craig Raw
2026-01-13 14:49:25 +02:00
parent cf15760d34
commit 0515d8056b
@@ -3,6 +3,7 @@ package com.sparrowwallet.sparrow.net;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.sparrowwallet.sparrow.AppServices;
import com.sparrowwallet.sparrow.SparrowWallet;
import com.sparrowwallet.sparrow.event.ExchangeRatesUpdatedEvent;
import com.sparrowwallet.tern.http.client.HttpResponseException;
import javafx.concurrent.ScheduledService;
@@ -151,7 +152,7 @@ public enum ExchangeSource {
HttpClientService httpClientService = AppServices.getHttpClientService();
try {
return httpClientService.requestJson(url, CoinGeckoRates.class, null);
return httpClientService.requestJson(url, CoinGeckoRates.class, Map.of("User-Agent", "Mozilla/4.0 (compatible; MSIE 9.0; Windows NT 6.1)", "Accept", "*/*"));
} catch(Exception e) {
if(log.isDebugEnabled()) {
log.warn("Error retrieving currency rates", e);