Skip to content

Commit

Permalink
Tweaks. Thanks to Ivan Krylov.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@87665 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
hornik committed Jan 29, 2025
1 parent 1f388b6 commit 2be09e1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/library/tools/R/urltools.R
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,8 @@ function(urls, nobody = FALSE, verbose = FALSE, pool = NULL,
curl::handle_setopt(h, .list = opts)
if(length(hdrs))
curl::handle_setheaders(h, .list = hdrs)
if(grepl("^https?://github[.]com", u) &&
if((startsWith(u, "https://github.com/") ||
(u == "https://github.com")) &&
nzchar(a <- Sys.getenv("GITHUB_PAT", ""))) {
curl::handle_setheaders(h, "Authorization" = paste("token", a))
}
Expand Down Expand Up @@ -925,7 +926,8 @@ function(u, verbose = FALSE, opts = NULL, hdrs = NULL)
curl::handle_setopt(h, .list = opts)
if(length(hdrs))
curl::handle_setheaders(h, .list = hdrs)
if(startsWith(u, "https://github.com") &&
if((startsWith(u, "https://github.com/") ||
(u == "https://github.com")) &&
nzchar(a <- Sys.getenv("GITHUB_PAT", "")))
curl::handle_setheaders(h, "Authorization" = paste("token", a))

Expand Down

0 comments on commit 2be09e1

Please sign in to comment.