Maintenance scheduled for Thursday, January 27th at 15:00 MST. Expected downtime <1 hour.

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 @@
#' }
getWebServiceData <- function(obs_url, ...){
if (!curl::has_internet()) {
if (!has_internet_2(obs_url)) {
message("No internet connection.")
return(invisible(NULL))
}
......@@ -111,11 +111,7 @@ default_ua <- function() {
#' @keywords internal
#' @param obs_url character obs_url to check
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 )
!is.null(curl::nslookup(host, error = FALSE))
......
Markdown is supported
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