Wow, this was a tricky issue to debug. This is not related to “prefer canonical URL” change.
Also, this issue is not specific to GitHub only, but all the sites that uses # magic. For example:
This regression was introduced eleven days ago in this commit. Specifically in this code:
URI(URI.escape(url)) if url
Escaping the URL converts/encodes # in link to %23 and some sites does not handle that well, GitHub and Ars Technica included.
Wikipedia handle this just well, for example:
https://en.wikipedia.org/wiki/Percent-encoding#Percent-encoding_reserved_characters
@eviltrout should we remove the URL escaping here? Or add a new case for sites with 404 response?