From d099882402ef73ebecbfcfd3001e118b273fb862 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Thu, 19 Sep 2019 08:54:41 +0200 Subject: [PATCH] Prevent redirects for wrong server url --- drone/internal/util.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drone/internal/util.go b/drone/internal/util.go index efa91da..46c8ec6 100644 --- a/drone/internal/util.go +++ b/drone/internal/util.go @@ -49,6 +49,10 @@ func NewClient(c *cli.Context) (drone.Client, error) { }, ) + auther.CheckRedirect = func(*http.Request, []*http.Request) error { + return fmt.Errorf("Attempting to redirect the requests. Did you configure the correct drone server address?") + } + trans, _ := auther.Transport.(*oauth2.Transport) if len(socks) != 0 && !socksoff {