r-lib / urlchecker

Run CRAN URL checks from older versions of R
https://urlchecker.r-lib.org/
GNU General Public License v3.0
45 stars 5 forks source link

Doesn't preserve fragments #9

Closed hadley closed 2 years ago

hadley commented 3 years ago

The suggested replacement for https://www.tidyverse.org/lifecycle/#maturing is https://lifecycle.r-lib.org/articles/stages.html, which loses the url fragment

jimhester commented 3 years ago

Yes, but this is due to the code in tools, I am not sure we should change this, in general I am trying to make sure our code stays as close to CRANs as we realistically can so we can reproduce their results.

hadley commented 3 years ago

It is objectively wrong though, because following a redirected link will preserve the fragment. Maybe another patch to R-core?

jimhester commented 3 years ago

yeah I could look into it, will keep this open.

gaborcsardi commented 2 years ago

The standard says that the fragment should be preserved if the new url does not have a fragment: https://www.rfc-editor.org/rfc/rfc7231#section-7.1.2

gaborcsardi commented 2 years ago

Submitted patch to base R: https://bugs.r-project.org/show_bug.cgi?id=18316

I'll add this to urlchecker, nevertheless. If base is not patched then we'll need to update urltools.R from R's SVN more carefully in the future.

gaborcsardi commented 2 years ago

This is now fixed in (tomorrow's) R-devel: https://github.com/wch/r-source/commit/2dc39e30df390b48218f9b062f829bbc64e347b2