Skip to content

Commit fbf3a25

Browse files
committed
devapp: revert status changes
This reverts the status changes to devapp from CL 96416 This will go into its own server instead. Updates golang/go#21315 Updates golang/go#22603 Change-Id: Icb17a5915124241b2ef97a1ee2e9a0e4298784ce Reviewed-on: https://go-review.googlesource.com/97516 Reviewed-by: Andrew Bonventre <[email protected]>
1 parent 3d62d0f commit fbf3a25

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

devapp/devapp.go

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ func main() {
6262
go func() {
6363
handler := http.Handler(s)
6464
if *autocertBucket != "" {
65-
handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
66-
redirectHTTP(w, r, s)
67-
})
65+
handler = http.HandlerFunc(redirectHTTP)
6866
}
6967
errc <- fmt.Errorf("http.Serve = %v", http.Serve(ln, handler))
7068
}()
@@ -79,19 +77,11 @@ func main() {
7977
log.Fatal(<-errc)
8078
}
8179

82-
func redirectHTTP(w http.ResponseWriter, r *http.Request, h http.Handler) {
80+
func redirectHTTP(w http.ResponseWriter, r *http.Request) {
8381
if r.TLS != nil || r.Host == "" {
8482
http.NotFound(w, r)
8583
return
8684
}
87-
88-
// Serve /status directly, without a forced redirect.
89-
// This lets monitoring avoid a dependency on LetsEncrypt being up.
90-
if strings.HasPrefix(r.RequestURI, "/status") {
91-
h.ServeHTTP(w, r)
92-
return
93-
}
94-
9585
http.Redirect(w, r, "https://"+r.Host+r.RequestURI, http.StatusFound)
9686
}
9787

devapp/server.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import (
1919

2020
"golang.org/x/build/maintner"
2121
"golang.org/x/build/maintner/godata"
22-
"golang.org/x/build/status/statusserver"
2322
)
2423

2524
// A server is an http.Handler that serves content within staticDir at root and
@@ -63,10 +62,6 @@ func newServer(mux *http.ServeMux, staticDir, templateDir string) *server {
6362
s.mux.HandleFunc("/release", s.withTemplate("/release.tmpl", s.handleRelease))
6463
s.mux.HandleFunc("/reviews", s.withTemplate("/reviews.tmpl", s.handleReviews))
6564
s.mux.HandleFunc("/dir/", handleDirRedirect)
66-
67-
ss := statusserver.NewHandler()
68-
ss.Register(s.mux) // at /status
69-
7065
for _, p := range []string{"/imfeelinghelpful", "/imfeelinglucky"} {
7166
s.mux.HandleFunc(p, s.handleRandomHelpWantedIssue)
7267
}

0 commit comments

Comments
 (0)