8000 Pull latest changes from upstream by bbrown-cw · Pull Request #6 · coreweave/gofish · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Pull latest changes from upstream #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package gofish
import (
"bytes"
"context"
"crypto/tls"
"encoding/base64"
"encoding/json"
"fmt"
Expand Down Expand Up @@ -121,10 +120,6 @@ func setupClientWithConfig(ctx context.Context, config *ClientConfig) (c *APICli
client.sem = make(chan bool, config.MaxConcurrentRequests)
}

if config.TLSHandshakeTimeout == 0 {
config.TLSHandshakeTimeout = 10
}

if config.HTTPClient == nil {
defaultTransport := http.DefaultTransport.(*http.Transport)
transport := &http.Transport{
Expand All @@ -133,10 +128,20 @@ func setupClientWithConfig(ctx context.Context, config *ClientConfig) (c *APICli
MaxIdleConns: defaultTransport.MaxIdleConns,
IdleConnTimeout: defaultTransport.IdleConnTimeout,
ExpectContinueTimeout: defaultTransport.ExpectContinueTimeout,
TLSClientConfig: defaultTransport.TLSClientConfig,
TLSHandshakeTimeout: time.Duration(config.TLSHandshakeTimeout) * time.Second,
TLSClientConfig: &tls.Config{
InsecureSkipVerify: config.Insecure,
},
}

config.HTTPClient = &http.Client{Transport: transport}
}

client.HTTPClient = config.HTTPClient

// if the provided HTTPClient uses a standard Transport, we want to
// amend its configuration to match what was provided to us
if transport, ok := client.HTTPClient.Transport.(*http.Transport); ok {
if config.Insecure {
transport.TLSClientConfig.InsecureSkipVerify = config.Insecure
}

if config.ReuseConnections {
Expand All @@ -145,12 +150,9 @@ func setupClientWithConfig(ctx context.Context, config *ClientConfig) (c *APICli
transport.IdleConnTimeout = 1 * time.Minute
}

client.HTTPClient = &http.Client{Transport: transport}
} else {
if config.ReuseConnections {
client.keepAlive = true
if config.TLSHandshakeTimeout != 0 {
transport.TLSHandshakeTimeout = time.Duration(config.TLSHandshakeTimeout) * time.Second
}
client.HTTPClient = config.HTTPClient
}

// Fetch the service root
Expand Down
2 changes: 1 addition & 1 deletion redfish/trustedcomponent.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ type TrustedComponent struct {
Status common.Status
// TPM shall contain TPM-specific information for this trusted component. This property shall only be present for
// TCG-defined TPM trusted components.
TPM string
TPM TPM
// TrustedComponentType shall contain the type of trusted component.
TrustedComponentType TrustedComponentType
// UUID shall contain a universally unique identifier number for the trusted component.
Expand Down
0