mirror of
https://github.com/mudler/luet.git
synced 2025-09-06 17:50:34 +00:00
Switch to go mod
This commit is contained in:
23
vendor/github.com/heroku/docker-registry-client/registry/basictransport.go
generated
vendored
Normal file
23
vendor/github.com/heroku/docker-registry-client/registry/basictransport.go
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
package registry
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type BasicTransport struct {
|
||||
Transport http.RoundTripper
|
||||
URL string
|
||||
Username string
|
||||
Password string
|
||||
}
|
||||
|
||||
func (t *BasicTransport) RoundTrip(req *http.Request) (*http.Response, error) {
|
||||
if strings.HasPrefix(req.URL.String(), t.URL) {
|
||||
if t.Username != "" || t.Password != "" {
|
||||
req.SetBasicAuth(t.Username, t.Password)
|
||||
}
|
||||
}
|
||||
resp, err := t.Transport.RoundTrip(req)
|
||||
return resp, err
|
||||
}
|
Reference in New Issue
Block a user