Skip to content

Commit

Permalink
fix: set enclave hostname if relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
natesales committed Jan 21, 2025
1 parent 50a19ff commit c201eac
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,18 @@ func (s *SecureClient) HTTPClient() (*http.Client, error) {
}

func (s *SecureClient) makeRequest(req *http.Request) (*Response, error) {
resp, err := s.HTTPClient().Do(req)
httpClient, err := s.HTTPClient()
if err != nil {
return nil, err
}

// If URL doesn't start with anything, assume it's a relative path and set the base URL
if req.URL.Host == "" {
req.URL.Scheme = "https"
req.URL.Host = s.enclave
}

resp, err := httpClient.Do(req)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit c201eac

Please sign in to comment.