You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 6, 2024. It is now read-only.
Good chance it's something wrong that I've done here. Why is rawgit.com redirecting to raw.githubusercontent.com in this case?
❯❯❯ curl https://rawgit.com/ruby/ruby/commit/b3dbeb6e90f316584f70e33f6bfb9d83fa5f30d3.patch
<p>Moved Permanently. Redirecting to <a href="https://raw.githubusercontent.com/ruby/ruby/commit/b3dbeb6e90f316584f70e33f6bfb9d83fa5f30d3.patch">https://raw.githubusercontent.com/ruby/ruby/commit/b3dbeb6e90f316584f70e33f6bfb9d83fa5f30d3.patch</a></p>
❯❯❯ curl https://cdn.rawgit.com/ruby/ruby/commit/b3dbeb6e90f316584f70e33f6bfb9d83fa5f30d3.patch
404: Not Found
/ruby/ruby/commit/b3dbeb6e90f316584f70e33f6bfb9d83fa5f30d3.patch doesn't actually point to a file in a repo, it points to a dynamic endpoint on GitHub that generates a patch file for a specific commit. RawGit only supports fetching actual repo files.
Normally RawGit would just return a 404 for paths it doesn't support. But in this case the path actually looks like it could be a file path, so RawGit tries to process it as one.
.patch isn't a whitelisted file extension, so rawgit.com assumes there's no benefit to proxying it and redirects you directly to GitHub to load it. But the redirect assumes the path is an actual repo file. raw.githubusercontent.com only knows how to handle repo files, so it returns a 404 because the path we're requesting is a dynamic endpoint, not a repo file.
cdn.rawgit.com doesn't use the extension whitelist, so it just tries to load the file from GitHub. But once again, since the path doesn't point to an actual file, we get a 404.
tl;dr: RawGit only supports repo files, not dynamic GitHub endpoints, and ruby/ruby/commit/b3dbeb6e90f316584f70e33f6bfb9d83fa5f30d3.patch isn't a repo file. Sorry.
We could do a better job of recognizing that /:user/:repo/commit/* isn't a file URL though, so I'll leave this open as a bug.
rgrove
changed the title
Rawgit redirects to raw.githubusercontent.com
Should return a 404 for non-file (but file-like) URLs such as /:user/:repo/commit/*
Apr 30, 2018
Good chance it's something wrong that I've done here. Why is
rawgit.com
redirecting toraw.githubusercontent.com
in this case?ruby/ruby@b3dbeb6
The text was updated successfully, but these errors were encountered: