@@ -16,6 +16,7 @@ import (
1616 "github.com/bitly/go-simplejson"
1717)
1818
19+const pingPath = "/ping"
1920const signInPath = "/oauth2/sign_in"
2021const oauthStartPath = "/oauth2/start"
2122const oauthCallbackPath = "/oauth2/callback"
@@ -192,6 +193,11 @@ func (p *OauthProxy) SetCookie(rw http.ResponseWriter, req *http.Request, val st
192193 http.SetCookie(rw, cookie)
193194}
194195
196+func (p *OauthProxy) PingPage(rw http.ResponseWriter) {
197+ rw.WriteHeader(http.StatusOK)
198+ fmt.Fprintf(rw, "OK")
199+}
200+
195201func (p *OauthProxy) ErrorPage(rw http.ResponseWriter, code int, title string, message string) {
196202 log.Printf("ErrorPage %d %s %s", code, title, message)
197203 rw.WriteHeader(code)
@@ -267,6 +273,11 @@ func (p *OauthProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
267273 var ok bool
268274 var user string
269275
276+ if req.URL.Path == pingPath {
277+ p.PingPage(rw)
278+ return
279+ }
280+
270281 if req.URL.Path == signInPath {
271282 redirect, err := p.GetRedirect(req)
272283 if err != nil {