Skip to content

Commit

Permalink
No longer need http for getCapabilities request. #329 (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
ateucher authored Oct 6, 2023
1 parent 64ebee4 commit 937140b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
4 changes: 2 additions & 2 deletions R/bcdc_options.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down
9 changes: 2 additions & 7 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand Down

0 comments on commit 937140b

Please sign in to comment.