diff --git a/CHANGELOG.md b/CHANGELOG.md index 6eb8409a3..82bfc9abc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ FIXES: * fixed a number of linting errors highlighted by gometalinter [#PR209](https://github.com/gambol99/keycloak-proxy/pull/209) * added docker image instructions to the readme [#PR204](https://github.com/gambol99/keycloak-proxy/pull/204) * added unit tests for the debug handlers [#PR223](https://github.com/gambol99/keycloak-proxy/pull/223) +* fixing the logout handler panic when revocation url is not set [#PR254](https://github.com/gambol99/keycloak-proxy/pull/254) FEATURES * changed the routing engine from gin to echo diff --git a/handlers.go b/handlers.go index f5fae2519..944ce1801 100644 --- a/handlers.go +++ b/handlers.go @@ -295,7 +295,13 @@ func (r *oauthProxy) logoutHandler(w http.ResponseWriter, req *http.Request) { }() } - revocationURL := defaultTo(r.config.RevocationEndpoint, r.idp.EndSessionEndpoint.String()) + // set the default revocation url + revokeDefault := "" + if r.idp.EndSessionEndpoint != nil { + revokeDefault = r.idp.EndSessionEndpoint.String() + } + revocationURL := defaultTo(r.config.RevocationEndpoint, revokeDefault) + // step: do we have a revocation endpoint? if revocationURL != "" { client, err := r.client.OAuthClient()