@@ -272,6 +272,7 @@ func (p *OauthProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
273 var ok bool
273 var ok bool
274 var user string
274 var user string
276 if req.URL.Path == pingPath {
277 if req.URL.Path == pingPath {
277 p.PingPage(rw)
278 p.PingPage(rw)
@@ -343,7 +344,6 @@ func (p *OauthProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
344 cookie, err := req.Cookie(p.CookieKey)
345 cookie, err := req.Cookie(p.CookieKey)
345 if err == nil {
346 if err == nil {
347 email, ok = validateCookie(cookie, p.CookieSeed)
347 email, ok = validateCookie(cookie, p.CookieSeed)
348 user = strings.Split(email, "@")[0]
348 user = strings.Split(email, "@")[0]
@@ -368,6 +368,7 @@ func (p *OauthProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
368 if *passBasicAuth {
368 if *passBasicAuth {
369 req.SetBasicAuth(user, "")
369 req.SetBasicAuth(user, "")
370 req.Header["X-Forwarded-User"] = []string{user}
370 req.Header["X-Forwarded-User"] = []string{user}
371+ req.Header["X-Forwarded-Email"] = []string{email}
373 p.serveMux.ServeHTTP(rw, req)
374 p.serveMux.ServeHTTP(rw, req)