Skip to content
Snippets Groups Projects
Commit 15d55b51 authored by Rohith's avatar Rohith
Browse files

Merge pull request #23 from gambol99/cors_redirect

- adding the cors to the redirect
parents 800a818e 3413dd77
No related branches found
No related tags found
No related merge requests found
...@@ -192,6 +192,9 @@ func (r *KeycloakProxy) Run() error { ...@@ -192,6 +192,9 @@ func (r *KeycloakProxy) Run() error {
// redirectToURL redirects the user and aborts the context // redirectToURL redirects the user and aborts the context
func (r KeycloakProxy) redirectToURL(url string, cx *gin.Context) { func (r KeycloakProxy) redirectToURL(url string, cx *gin.Context) {
// step: add the cors headers
r.corsAccessHeaders(cx)
cx.Redirect(http.StatusTemporaryRedirect, url) cx.Redirect(http.StatusTemporaryRedirect, url)
cx.Abort() cx.Abort()
} }
......
...@@ -94,6 +94,7 @@ func newFakeKeycloakProxy(t *testing.T) *KeycloakProxy { ...@@ -94,6 +94,7 @@ func newFakeKeycloakProxy(t *testing.T) *KeycloakProxy {
Roles: []string{}, Roles: []string{},
}, },
}, },
CORSConfig: &CORS{},
}, },
proxy: new(fakeReverseProxy), proxy: new(fakeReverseProxy),
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment