Bug: incorrect R repos warning on RStudio startup

If it happens that user set default CRAN mirror in .Rprofile using lowercase name of cran mirror address, RStudio will raise incorrect warning:

R version 3.5.0 (2018-04-23) -- "Joy in Playing"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

WARNING: Your CRAN mirror is set to "http://cran.rstudio.com/" which has an insecure (non-HTTPS) URL. The repository was likely specified in .Rprofile or Rprofile.site so if you wish to change it you may need to edit one of those files. You should either switch to a repository that supports HTTPS or change your RStudio options to not require HTTPS downloads.

To learn more and/or disable this warning message see the "Use secure download method for HTTP" option in Tools -> Global Options -> Packages.
> getOption("repos")
                         cran 
"https://cloud.r-project.org"

Warning is gone if uppercase name of url is used: "CRAN".
Not sure if it matters but R used by RStudio was built from sources, .Rprofile is located in home dir.

The warning is misleading, but I'm not sure there's much for RStudio to do here -- the repository name CRAN does indeed need to be uppercase.