1
0
mirror of https://github.com/drone/drone-cli.git synced 2024-11-26 06:07:05 +01:00

Prevent redirects for wrong server url

This commit is contained in:
Thomas Boerger 2019-09-19 08:54:41 +02:00
parent a986f7c87c
commit d099882402
No known key found for this signature in database
GPG Key ID: 09745AFF9D63C79B

@ -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 {