Skip to content

Commit

Permalink
fix: clean url to remove duplicate slashes
Browse files Browse the repository at this point in the history
  • Loading branch information
ymarcon committed Sep 18, 2024
1 parent 0561afd commit 4389fa8
Show file tree
Hide file tree
Showing 132 changed files with 338 additions and 324 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 10 additions & 2 deletions R/opal.R
Original file line number Diff line number Diff line change
Expand Up @@ -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("(?<!:)//+", "/", url, perl = TRUE)
}

#' Constructs the value for the Authorization header
Expand Down Expand Up @@ -598,7 +606,7 @@ opal.delete <- function(opal, ..., query = list(), callback = NULL) {
opal$uprofile <- .handleResponse(opal, r)
opal$username <- opal$uprofile$principal

if (isTRUE(o$uprofile$otpRequired)) {
if (isTRUE(opal$uprofile$otpRequired)) {
warning("Enabling 2FA is required, connect to Opal web page to set up your secret.", call. = FALSE)
}

Expand Down
6 changes: 3 additions & 3 deletions man/dsadmin.get_method.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/dsadmin.get_methods.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/dsadmin.get_options.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/dsadmin.install_github_package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/dsadmin.install_local_package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/dsadmin.install_package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/dsadmin.installed_package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/dsadmin.package_description.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/dsadmin.package_descriptions.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/dsadmin.profile.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/dsadmin.profile_access.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/dsadmin.profile_create.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/dsadmin.profile_delete.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/dsadmin.profile_enable.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/dsadmin.profile_exists.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/dsadmin.profile_init.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/dsadmin.profile_perm.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4389fa8

Please sign in to comment.