From 338fce1263fb78041db613fd4c27d3f862e6c2e3 Mon Sep 17 00:00:00 2001 From: Philip Bjorge Date: Wed, 25 Oct 2017 13:39:25 -0700 Subject: [PATCH 1/2] Use pass access scheme in signin url --- pkg/nginx/template/template.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/nginx/template/template.go b/pkg/nginx/template/template.go index 6ec0cf3881..5469000a7f 100644 --- a/pkg/nginx/template/template.go +++ b/pkg/nginx/template/template.go @@ -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) } From 214e13c25649bf262722c58d6a2b3ea63d12485d Mon Sep 17 00:00:00 2001 From: Philip Bjorge Date: Wed, 25 Oct 2017 13:41:49 -0700 Subject: [PATCH 2/2] Update template_test.go --- pkg/nginx/template/template_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/nginx/template/template_test.go b/pkg/nginx/template/template_test.go index b22994e061..cecc69b9af 100644 --- a/pkg/nginx/template/template_test.go +++ b/pkg/nginx/template/template_test.go @@ -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 {