Merge pull request #1587 from philipbjorge/patch-2

Use pass access scheme in signin url
This commit is contained in:
Manuel Alejandro de Brito Fontes 2017-10-25 18:01:59 -03:00 committed by GitHub
commit f8c2fb9604
2 changed files with 4 additions and 4 deletions

View file

@ -690,12 +690,12 @@ func buildAuthSignURL(input interface{}) string {
u, _ := url.Parse(s) u, _ := url.Parse(s)
q := u.Query() q := u.Query()
if len(q) == 0 { 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") != "" { if q.Get("rd") != "" {
return s 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)
} }

View file

@ -386,8 +386,8 @@ func TestBuildAuthSignURL(t *testing.T) {
cases := map[string]struct { cases := map[string]struct {
Input, Output string Input, Output string
}{ }{
"default url": {"http://google.com", "http://google.com?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=$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"}, "with rd field": {"http://google.com?cat&rd=$request", "http://google.com?cat&rd=$request"},
} }
for k, tc := range cases { for k, tc := range cases {