From a995d4ff594df8523db91a6e0362e8000d7ff793 Mon Sep 17 00:00:00 2001 From: eblondel Date: Fri, 26 Jan 2024 11:01:11 +0100 Subject: [PATCH] fix #119 --- R/WCSCoverageSummary.R | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/R/WCSCoverageSummary.R b/R/WCSCoverageSummary.R index 8e3336d..0af38dc 100644 --- a/R/WCSCoverageSummary.R +++ b/R/WCSCoverageSummary.R @@ -219,7 +219,6 @@ WCSCoverageSummary <- R6Class("WCSCoverageSummary", label = "time", uom = "s", type = "temporal", coefficients = des$Domain$temporalDomain$instants ) - } } @@ -231,7 +230,8 @@ WCSCoverageSummary <- R6Class("WCSCoverageSummary", self$ERROR("No 'srsName' envelope attribute for CRS interpretation") return(NULL) } - srsNameXML <- try(XML::xmlParse(srsName), silent = TRUE) + srsName = gsub("http://", "https://", srsName) #attempt to rewrite http to https + srsNameXML <- try(XML::xmlParse(httr::content(httr::GET(srsName),"text")), silent = TRUE) if(is(srsNameXML,"try-error")){ self$ERROR(sprintf("Error during CRS interpretation for srsName = '%s'", srsName)) return(NULL) @@ -247,8 +247,9 @@ WCSCoverageSummary <- R6Class("WCSCoverageSummary", out_crs <- thecrs crsHref <- thecrs$attrs[["xlink:href"]] if(!is.null(crsHref)){ + crsHref = gsub("http://", "https://", crsHref) #attempt to rewrite http to https self$INFO(sprintf("Try to parse CRS from '%s'", crsHref)) - crsXML <- try(XML::xmlParse(crsHref)) + crsXML <- try(XML::xmlParse(httr::content(httr::GET(crsHref),"text")), silent = TRUE) if(is(crsXML, "try-error")){ self$ERROR(sprintf("Error during parsing CRS '%s'", crsHref)) return(NULL)