diff --git a/main.go b/main.go index 49f36e8..8ef9839 100644 --- a/main.go +++ b/main.go @@ -157,6 +157,16 @@ func (repo *Repo) SetVersions(all []Version) { } } +type repoBase struct { + user string + name string +} + +var redirect = map[repoBase]repoBase{ + // https://github.com/go-fsnotify/fsnotify/issues/1 + {"", "fsnotify"}: {"fsnotify", "fsnotify"}, +} + // GitHubRoot returns the repository root at GitHub, without a schema. func (repo *Repo) GitHubRoot() string { if repo.User == "" { @@ -249,6 +259,10 @@ func handler(resp http.ResponseWriter, req *http.Request) { FullVersion: InvalidVersion, } + if r, ok := redirect[repoBase{repo.User, repo.Name}]; ok { + repo.User, repo.Name = r.user, r.name + } + var ok bool repo.MajorVersion, ok = parseVersion(m[3]) if !ok {