go: include vendored modules
RHEL requires the source code for dependencies to be included in the srpm. The spec file already expects that, but we've only included the vendored modules (i.e., the `vendor` directory) in the `rhel-8.2.` branch. Move vendoring to master, so that we can build RHEL packages from it as well. This commit is the result of running `go mod vendor`, which includes the vendored sources and updates go.mod and go.sum files. Fedora requires the opposite: dependencies should not be vendored. The spec file already ignores the `vendor` directory by default.
This commit is contained in:
parent
4f2ac6a687
commit
6703055925
468 changed files with 268066 additions and 0 deletions
51
vendor/github.com/mattn/go-ieproxy/proxyMiddleman_windows.go
generated
vendored
Normal file
51
vendor/github.com/mattn/go-ieproxy/proxyMiddleman_windows.go
generated
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
package ieproxy
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
|
||||
"golang.org/x/net/http/httpproxy"
|
||||
)
|
||||
|
||||
func proxyMiddleman() func(req *http.Request) (i *url.URL, e error) {
|
||||
// Get the proxy configuration
|
||||
conf := GetConf()
|
||||
envcfg := httpproxy.FromEnvironment()
|
||||
|
||||
if envcfg.HTTPProxy != "" || envcfg.HTTPSProxy != "" {
|
||||
// If the user manually specifies environment variables, prefer those over the Windows config.
|
||||
return http.ProxyFromEnvironment
|
||||
} else if conf.Automatic.Active {
|
||||
// If automatic proxy obtaining is specified
|
||||
return func(req *http.Request) (i *url.URL, e error) {
|
||||
host := conf.Automatic.FindProxyForURL(req.URL.String())
|
||||
if host == "" {
|
||||
return nil, nil
|
||||
}
|
||||
return &url.URL{Host: host}, nil
|
||||
}
|
||||
} else if conf.Static.Active {
|
||||
// If static proxy obtaining is specified
|
||||
prox := httpproxy.Config{
|
||||
HTTPSProxy: mapFallback("https", "", conf.Static.Protocols),
|
||||
HTTPProxy: mapFallback("http", "", conf.Static.Protocols),
|
||||
NoProxy: conf.Static.NoProxy,
|
||||
}
|
||||
|
||||
return func(req *http.Request) (i *url.URL, e error) {
|
||||
return prox.ProxyFunc()(req.URL)
|
||||
}
|
||||
} else {
|
||||
// Final fallthrough case; use the environment variables.
|
||||
return http.ProxyFromEnvironment
|
||||
}
|
||||
}
|
||||
|
||||
// Return oKey or fbKey if oKey doesn't exist in the map.
|
||||
func mapFallback(oKey, fbKey string, m map[string]string) string {
|
||||
if v, ok := m[oKey]; ok {
|
||||
return v
|
||||
} else {
|
||||
return m[fbKey]
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue