mirror of https://github.com/perkeep/perkeep.git
website: redirect /issue/NNN to codesite issue tracker
Change-Id: I323311421bb9d72eb043f3694d78a9bc9931a3d6
This commit is contained in:
parent
a44e75435b
commit
ef669b8df0
|
@ -321,6 +321,7 @@ func main() {
|
|||
Static: http.StripPrefix("/code/", http.FileServer(http.Dir(*gitwebFiles))),
|
||||
}})
|
||||
}
|
||||
mux.HandleFunc("/issue/", issueRedirect)
|
||||
mux.HandleFunc("/", mainHandler)
|
||||
|
||||
if *buildbotHost != "" && *buildbotBackend != "" {
|
||||
|
@ -363,6 +364,17 @@ func main() {
|
|||
log.Fatalf("Serve error: %v", <-errch)
|
||||
}
|
||||
|
||||
var issueNum = regexp.MustCompile(`^/issue/(\d+)$`)
|
||||
|
||||
func issueRedirect(w http.ResponseWriter, r *http.Request) {
|
||||
m := issueNum.FindStringSubmatch(r.URL.Path)
|
||||
if m == nil {
|
||||
http.Error(w, "Bad request", 400)
|
||||
return
|
||||
}
|
||||
http.Redirect(w, r, "https://code.google.com/p/camlistore/issues/detail?id=" + m[1], http.StatusFound)
|
||||
}
|
||||
|
||||
type fixUpGitwebUrls struct {
|
||||
handler http.Handler
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue