proxy: fix group impersonation bug

Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
Bobby DeSimone 2019-09-16 19:23:55 -07:00
parent b373634012
commit decf661eb0
No known key found for this signature in database
GPG key ID: AEE4CF12FE86D07E
2 changed files with 8 additions and 1 deletions

View file

@ -23,6 +23,10 @@
- Removed `AUTHENTICATE_INTERNAL_URL`/`authenticate_internal_url` which is no longer used.
## Fixed
- Fixed a bug where the impersonate form would persist an empty string for groups value if none set.[GH-303](https://github.com/pomerium/pomerium/issues/303)
## v0.3.0
### New

View file

@ -233,7 +233,10 @@ func (p *Proxy) Impersonate(w http.ResponseWriter, r *http.Request) {
// OK to impersonation
session.ImpersonateEmail = r.FormValue("email")
session.ImpersonateGroups = strings.Split(r.FormValue("group"), ",")
groups := r.FormValue("group")
if groups != "" {
session.ImpersonateGroups = strings.Split(groups, ",")
}
if err := p.sessionStore.SaveSession(w, r, session); err != nil {
httputil.ErrorResponse(w, r, err)
return