NEWS


safeconduct 0.1.0

First release.

Why this package exists

On October 2, 2026 Statistics Canada moved parts of its website behind a Cloudflare browser check, among them the census geography and correspondence files on www12.statcan.gc.ca. A plain HTTP request from R, whether through download.file(), curl or anything built on them, has been answered with a 403 check page instead of the file ever since, so those files became unreachable from R by the usual means. That broke functionality in the cancensus package, which downloads such files on its users' behalf, and it broke every script that fetched them directly.

Statistics Canada is not alone. The City of Vancouver's Open Data portal has moved its large file downloads behind a Cloudflare check as well. The VancouvR package is itself unaffected, since the API it talks to and the download links it serves work as before and nothing in the package starts a download, but a user who follows one of those links programmatically fails unless the download goes through safeconduct. As more public data moves behind such checks, the need for this is broader than one package or one agency.

safeconduct restores that access as a drop-in replacement for the download: where a script called download.file(url, destfile), it calls safeconduct::fetch(url, destfile), and a package does the same inside its own download helper. Where the server serves the file to a plain request, that is what happens and no browser is involved. Where it answers with a browser check or a block page, a real Chrome with a throwaway profile is opened on the host, the check runs, and the file is fetched: through curl carrying the clearance the browser was given where the server accepts that, and in the browser itself where it does not. The price is a dependency on an installed Chrome or Chromium, and, when a check insists on a click, a window that waits for the person at the screen to click it. Nothing is simulated and nothing is clicked on anyone's behalf, so a check that wants a click cannot be passed where no one is present, say in a container or on a build server.

What is in it