From 4294be57d1f8d00b02adba5334c7e4f4c353a1a3 Mon Sep 17 00:00:00 2001 From: Michael Uleysky Date: Fri, 26 Jul 2024 19:11:39 +1000 Subject: [PATCH] Added supporting proxy for access to the COPERNICUS catalog --- src/copcat.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/copcat.cpp b/src/copcat.cpp index b1bfaee..7ed9a72 100644 --- a/src/copcat.cpp +++ b/src/copcat.cpp @@ -7,16 +7,20 @@ const MString CopernicusCatalog::caturl = "https://stac.marine.copernicus.eu/met CopernicusCatalog::CopernicusCatalog() { - // Cache auto oldprefix = michlib::GPL.UsePrefix("COPERNICUS"); + // Cache cache.reset(CreateCache(michlib::GPL.ParameterSValue("Cache", ""))); - michlib::GPL.UsePrefix(oldprefix); if(!cache) { michlib::errmessage("Can't init cache"); cache.reset(new FakeCache); } + // Proxy + auto proxyurl = michlib::GPL.ParameterSValue("Proxy", ""); + if(proxyurl.Exist()) curl_easy_setopt(chandle, CURLOPT_PROXY, proxyurl.Buf()); + + michlib::GPL.UsePrefix(oldprefix); GetCatalog(); }