@@ -16,6 +16,7 @@ import (
16 "github.com/bitly/go-simplejson"
16 "github.com/bitly/go-simplejson"
19+const pingPath = "/ping"
19const signInPath = "/oauth2/sign_in"
20const signInPath = "/oauth2/sign_in"
20const oauthStartPath = "/oauth2/start"
21const oauthStartPath = "/oauth2/start"
21const oauthCallbackPath = "/oauth2/callback"
22const oauthCallbackPath = "/oauth2/callback"
@@ -192,6 +193,11 @@ func (p *OauthProxy) SetCookie(rw http.ResponseWriter, req *http.Request, val st
192 http.SetCookie(rw, cookie)
193 http.SetCookie(rw, cookie)
196+func (p *OauthProxy) PingPage(rw http.ResponseWriter) {
197+ rw.WriteHeader(http.StatusOK)
198+ fmt.Fprintf(rw, "OK")
195func (p *OauthProxy) ErrorPage(rw http.ResponseWriter, code int, title string, message string) {
201func (p *OauthProxy) ErrorPage(rw http.ResponseWriter, code int, title string, message string) {
196 log.Printf("ErrorPage %d %s %s", code, title, message)
202 log.Printf("ErrorPage %d %s %s", code, title, message)
197 rw.WriteHeader(code)
203 rw.WriteHeader(code)
@@ -267,6 +273,11 @@ func (p *OauthProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
267 var ok bool
273 var ok bool
268 var user string
274 var user string
276+ if req.URL.Path == pingPath {
270 if req.URL.Path == signInPath {
281 if req.URL.Path == signInPath {
271 redirect, err := p.GetRedirect(req)
282 redirect, err := p.GetRedirect(req)
272 if err != nil {
283 if err != nil {