mirror of https://github.com/perkeep/perkeep.git
website: redirect issues to github instead of google code
Change-Id: I0216bfc33be79f137277180f71a3492c69e39835
This commit is contained in:
parent
5c7208fb94
commit
088e5d850e
|
@ -399,7 +399,7 @@ func main() {
|
|||
log.Fatalf("Serve error: %v", <-errc)
|
||||
}
|
||||
|
||||
var issueNum = regexp.MustCompile(`^/(?:issue(?:s)?|bugs)(/\d*)?$`)
|
||||
var issueNum = regexp.MustCompile(`^/(?:issue|bug)s?(/\d*)?$`)
|
||||
|
||||
// issueRedirect returns whether the request should be redirected to the
|
||||
// issues tracker, and the url for that redirection if yes, the empty
|
||||
|
@ -410,11 +410,11 @@ func issueRedirect(urlPath string) (string, bool) {
|
|||
return "", false
|
||||
}
|
||||
issueNumber := strings.TrimPrefix(m[1], "/")
|
||||
suffix := "list"
|
||||
suffix := ""
|
||||
if issueNumber != "" {
|
||||
suffix = "detail?id=" + issueNumber
|
||||
suffix = "/" + issueNumber
|
||||
}
|
||||
return "https://code.google.com/p/camlistore/issues/" + suffix, true
|
||||
return "https://github.com/camlistore/camlistore/issues" + suffix, true
|
||||
}
|
||||
|
||||
func gerritRedirect(w http.ResponseWriter, r *http.Request) {
|
||||
|
|
|
@ -45,8 +45,8 @@ func TestRedirect(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestIsIssueRequest(t *testing.T) {
|
||||
wantNum := "https://code.google.com/p/camlistore/issues/detail?id=34"
|
||||
wantList := "https://code.google.com/p/camlistore/issues/list"
|
||||
wantNum := "https://github.com/camlistore/camlistore/issues/34"
|
||||
wantList := "https://github.com/camlistore/camlistore/issues"
|
||||
tests := []struct {
|
||||
urlPath string
|
||||
redirects bool
|
||||
|
|
Loading…
Reference in New Issue