Add redirect to handle improper fsnotify rename.
For details see: https://github.com/go-fsnotify/fsnotify/issues/1
This commit is contained in:
parent
52a51a4957
commit
f9c1285817
14
main.go
14
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user