diff --git a/DESCRIPTION b/DESCRIPTION index f890f16b..9c8f0219 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -48,6 +48,6 @@ URL: https://github.com/obiba/opalr/, https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1008880, https://www.datashield.org/ BugReports: https://github.com/obiba/opalr/issues/ -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.1 VignetteBuilder: knitr Encoding: UTF-8 diff --git a/R/opal.R b/R/opal.R index c2ddca06..ffded8fc 100644 --- a/R/opal.R +++ b/R/opal.R @@ -318,7 +318,15 @@ opal.delete <- function(opal, ..., query = list(), callback = NULL) { #' @import utils #' @keywords internal .url <- function(opal, ...) { - utils::URLencode(paste(opal$url, "ws", paste(c(...), collapse = "/"), sep = "/")) + parts <- c(...) + parts <- parts[parts != ""] + .cleanUrl(utils::URLencode(paste(opal$url, "ws", paste(parts, collapse = "/"), sep = "/"))) +} + +# Function to replace duplicated slashes but preserve '://' +.cleanUrl <- function(url) { + # Replace duplicated slashes only after the protocol (://) + gsub("(?