Skip to content

Commit

Permalink
Merge pull request #1587 from philipbjorge/patch-2
Browse files Browse the repository at this point in the history
Use pass access scheme in signin url
  • Loading branch information
aledbf committed Oct 25, 2017
2 parents 61d32ae + 214e13c commit f8c2fb9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/nginx/template/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -690,12 +690,12 @@ func buildAuthSignURL(input interface{}) string {
u, _ := url.Parse(s)
q := u.Query()
if len(q) == 0 {
return fmt.Sprintf("%v?rd=$scheme://$http_host$request_uri", s)
return fmt.Sprintf("%v?rd=$pass_access_scheme://$http_host$request_uri", s)
}

if q.Get("rd") != "" {
return s
}

return fmt.Sprintf("%v&rd=$scheme://$http_host$request_uri", s)
return fmt.Sprintf("%v&rd=$pass_access_scheme://$http_host$request_uri", s)
}
4 changes: 2 additions & 2 deletions pkg/nginx/template/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,8 @@ func TestBuildAuthSignURL(t *testing.T) {
cases := map[string]struct {
Input, Output string
}{
"default url": {"http://google.com", "http://google.com?rd=$scheme://$http_host$request_uri"},
"with random field": {"http://google.com?cat=0", "http://google.com?cat=0&rd=$scheme://$http_host$request_uri"},
"default url": {"http://google.com", "http://google.com?rd=$pass_access_scheme://$http_host$request_uri"},
"with random field": {"http://google.com?cat=0", "http://google.com?cat=0&rd=$pass_access_scheme://$http_host$request_uri"},
"with rd field": {"http://google.com?cat&rd=$request", "http://google.com?cat&rd=$request"},
}
for k, tc := range cases {
Expand Down

0 comments on commit f8c2fb9

Please sign in to comment.