File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,24 @@ tests <- function() {
8787 }, error = function (e ) FALSE )
8888 stopifnot(any(grepl(" authenticated.*true" , h )))
8989
90+ if (getOption(" download.file.method" ) == " libcurl" ) {
91+ cat(" - Basic auth using .netrc (libcurl only)\n " )
92+ fnetrc <- tempfile(tmpdir = getwd())
93+ writeLines(c(" machine developer.R-project.org" ,
94+ " login Aladdin" ,
95+ " password OpenSesame" ),
96+ fnetrc )
97+ with_options(list (netrc = fnetrc ), {
98+ ret <- tryCatch({
99+ h <- suppressWarnings(get_headers(
100+ " basic-auth/Aladdin/OpenSesame" ))
101+ TRUE
102+ }, error = function (e ) FALSE )
103+ stopifnot(ret && any(grepl(" authenticated.*true" , h )))
104+ })
105+ unlink(fnetrc )
106+ }
107+
90108 if (getOption(" download.file.method" ) == " libcurl" ) {
91109 cat(" - Multiple urls (libcurl only)\n " )
92110 urls <- get_path(c(" anything" , " headers" ))
You can’t perform that action at this time.
0 commit comments