mirror of
https://github.com/drone-plugins/drone-download.git
synced 2026-06-04 10:15:28 +08:00
Merge pull request #5 from drone-plugins/redirect-basicauth
Add basic auth on redirects
This commit is contained in:
@@ -57,6 +57,13 @@ func (p Plugin) Exec() error {
|
||||
InsecureSkipVerify: p.Config.SkipVerify,
|
||||
},
|
||||
},
|
||||
CheckRedirect: func(req *http.Request, via []*http.Request) error {
|
||||
if p.Config.Username != "" && p.Config.Password != "" {
|
||||
req.SetBasicAuth(p.Config.Username, p.Config.Password)
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
req, err := http.NewRequest(
|
||||
|
||||
Reference in New Issue
Block a user