From 59cf686759956a36dcc76e50c45af8bab97400cb Mon Sep 17 00:00:00 2001 From: Dawid Osuchowski Date: Fri, 11 Aug 2023 14:01:22 +0200 Subject: [PATCH] Add HTTPS to NBP API links - HTTPS everywhere! :D --- scripts/e-trade_tax_dividends.sh | 4 ++-- src/pl.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/e-trade_tax_dividends.sh b/scripts/e-trade_tax_dividends.sh index 8d1af4e..a7d9be9 100755 --- a/scripts/e-trade_tax_dividends.sh +++ b/scripts/e-trade_tax_dividends.sh @@ -3,11 +3,11 @@ function GetRate() { prev_day=`date -d "$1 1 day ago" +'%F'` -kurs=`curl -X GET "http://api.nbp.pl/api/exchangerates/rates/a/usd/$prev_day/?format=json"` +kurs=`curl -X GET "https://api.nbp.pl/api/exchangerates/rates/a/usd/$prev_day/?format=json"` while [ "$kurs" = "404 NotFound - Not Found - Brak danych" ]; do prev_day=`date -d "$prev_day 1 day ago" +'%F'` -kurs=`curl -X GET "http://api.nbp.pl/api/exchangerates/rates/a/usd/$prev_day/?format=json"` +kurs=`curl -X GET "https://api.nbp.pl/api/exchangerates/rates/a/usd/$prev_day/?format=json"` done # Extract value from Json output diff --git a/src/pl.rs b/src/pl.rs index 866153a..82e4e03 100644 --- a/src/pl.rs +++ b/src/pl.rs @@ -54,7 +54,7 @@ impl etradeTaxReturnHelper::Residency for PL { .build() .expect_and_log("Could not create REST API client"); - let base_exchange_rate_url = "http://api.nbp.pl/api/exchangerates/rates/a/"; + let base_exchange_rate_url = "https://api.nbp.pl/api/exchangerates/rates/a/"; dates.iter_mut().for_each(|(date, val)| { let mut converted_date = chrono::NaiveDate::parse_from_str(&date, "%m/%d/%y").unwrap();