Commit a18719e8 authored by Laura A DeCicco's avatar Laura A DeCicco
Browse files

Need to actually *call* the new function!

parent 40647168
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#' } #' }
getWebServiceData <- function(obs_url, ...){ getWebServiceData <- function(obs_url, ...){
if (!curl::has_internet()) { if (!has_internet_2(obs_url)) {
message("No internet connection.") message("No internet connection.")
return(invisible(NULL)) return(invisible(NULL))
} }
...@@ -111,11 +111,7 @@ default_ua <- function() { ...@@ -111,11 +111,7 @@ default_ua <- function() {
#' @keywords internal #' @keywords internal
#' @param obs_url character obs_url to check #' @param obs_url character obs_url to check
has_internet_2 <- function(obs_url) { has_internet_2 <- function(obs_url) {
# For now, we know exactly where we're sending our queries
# But, if we expose a setter, we'll probably need to move it
# to the url construction, set a host in the package enviornment?,
# or come up with some better regex here:
host <- gsub("^https://(?:www[.])?([^/]*).*$", "\\1", obs_url ) host <- gsub("^https://(?:www[.])?([^/]*).*$", "\\1", obs_url )
!is.null(curl::nslookup(host, error = FALSE)) !is.null(curl::nslookup(host, error = FALSE))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment