Skip to content

Commit 2be09e1

Browse files
author
hornik
committed
Tweaks. Thanks to Ivan Krylov.
git-svn-id: https://svn.r-project.org/R/trunk@87665 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 1f388b6 commit 2be09e1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/library/tools/R/urltools.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,8 @@ function(urls, nobody = FALSE, verbose = FALSE, pool = NULL,
869869
curl::handle_setopt(h, .list = opts)
870870
if(length(hdrs))
871871
curl::handle_setheaders(h, .list = hdrs)
872-
if(grepl("^https?://github[.]com", u) &&
872+
if((startsWith(u, "https://github.com/") ||
873+
(u == "https://github.com")) &&
873874
nzchar(a <- Sys.getenv("GITHUB_PAT", ""))) {
874875
curl::handle_setheaders(h, "Authorization" = paste("token", a))
875876
}
@@ -925,7 +926,8 @@ function(u, verbose = FALSE, opts = NULL, hdrs = NULL)
925926
curl::handle_setopt(h, .list = opts)
926927
if(length(hdrs))
927928
curl::handle_setheaders(h, .list = hdrs)
928-
if(startsWith(u, "https://github.com") &&
929+
if((startsWith(u, "https://github.com/") ||
930+
(u == "https://github.com")) &&
929931
nzchar(a <- Sys.getenv("GITHUB_PAT", "")))
930932
curl::handle_setheaders(h, "Authorization" = paste("token", a))
931933

0 commit comments

Comments
 (0)