R/http.R
raw| 1 | |
| 2 | renv_http_useragent <- function() { |
| 3 | |
| 4 | # https://github.com/rstudio/renv/issues/1787 |
| 5 | agent <- getOption("renv.http.useragent", default = getOption("HTTPUserAgent")) |
| 6 | if (is.character(agent) && length(agent) == 1L) |
| 7 | return(agent) |
| 8 | |
| 9 | renv_http_useragent_default() |
| 10 | |
| 11 | } |
| 12 | |
| 13 | renv_http_useragent_default <- function() { |
| 14 | version <- getRversion() |
| 15 | platform <- with(R.version, paste(version, platform, arch, os)) |
| 16 | sprintf("R/%s R (%s)", version, platform) |
| 17 | } |