Index: doc/appengine/main.go |
diff --git a/doc/appengine/main.go b/doc/appengine/main.go |
index 261440d418f5e24389b49f4d3601cf95a2d87968..e05870f5b2eeaed800f4ba9c4351de2a231a4871 100644 |
--- a/doc/appengine/main.go |
+++ b/doc/appengine/main.go |
@@ -31,13 +31,16 @@ import ( |
"google.golang.org/appengine/urlfetch" |
) |
-const baseURL = "https://chromium.googlesource.com/crashpad/crashpad/+/doc/doc/generated/?format=TEXT" |
- |
func init() { |
http.HandleFunc("/", handler) |
} |
func handler(w http.ResponseWriter, r *http.Request) { |
+ const ( |
+ baseURL = "https://chromium.googlesource.com/crashpad/crashpad/+/doc/doc/generated/?format=TEXT" |
+ bugBaseURL = "https://bugs.chromium.org/p/crashpad/" |
+ ) |
+ |
ctx := appengine.NewContext(r) |
client := urlfetch.Client(ctx) |
@@ -47,6 +50,17 @@ func handler(w http.ResponseWriter, r *http.Request) { |
return |
} |
+ if r.URL.Path == "/bug" || r.URL.Path == "/bug/" { |
+ http.Redirect(w, r, bugBaseURL, http.StatusFound) |
+ return |
+ } else if r.URL.Path == "/bug/new" { |
+ http.Redirect(w, r, bugBaseURL+"issues/entry", http.StatusFound) |
+ return |
+ } else if strings.HasPrefix(r.URL.Path, "/bug/") { |
+ http.Redirect(w, r, bugBaseURL+"issues/detail?id="+r.URL.Path[5:], http.StatusFound) |
+ return |
+ } |
+ |
u, err := url.Parse(baseURL) |
if err != nil { |
http.Error(w, err.Error(), http.StatusInternalServerError) |