From 937140b831f55de7e65f8a54dcab4a597c8a1961 Mon Sep 17 00:00:00 2001 From: Andy Teucher Date: Fri, 6 Oct 2023 13:09:52 -0700 Subject: [PATCH] No longer need http for getCapabilities request. #329 (#333) --- R/bcdc_options.R | 4 ++-- R/utils.R | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/R/bcdc_options.R b/R/bcdc_options.R index 5d380518..baaa7445 100644 --- a/R/bcdc_options.R +++ b/R/bcdc_options.R @@ -107,14 +107,14 @@ bcdc_get_capabilities <- function() { } if (has_internet()) { - url <- make_url(bcdc_web_service_host(https = FALSE), "geo/pub/ows") + url <- make_url(bcdc_web_service_host(), "geo/pub/ows") cli <- bcdc_http_client(url, auth = FALSE) cc <- try(cli$get(query = list( SERVICE = "WFS", VERSION = "2.0.0", - REQUEST = "Getcapabilities" + REQUEST = "GetCapabilities" )), silent = TRUE) if (inherits(cc, "try-error")) { diff --git a/R/utils.R b/R/utils.R index 2197d9bb..4a542bdd 100644 --- a/R/utils.R +++ b/R/utils.R @@ -28,13 +28,8 @@ wms_base_url <- function(host = bcdc_web_service_host()) { make_url(host, "geo/pub/wms") } -bcdc_web_service_host <- function(https = TRUE) { - host <- getOption("bcdata.web_service_host", - default = "https://openmaps.gov.bc.ca") - if (!https) { - return(gsub("^https", "http", host)) - } - host +bcdc_web_service_host <- function() { + getOption("bcdata.web_service_host", default = "https://openmaps.gov.bc.ca") } bcdata_user_agent <- function(){