Skip to content

Commit

Permalink
fix(client): no panic on missing BaseURL (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Nov 12, 2024
1 parent 2513638 commit 9e252ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/requestconfig/requestconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,10 @@ func retryDelay(res *http.Response, retryCount int) time.Duration {
}

func (cfg *RequestConfig) Execute() (err error) {
if cfg.BaseURL == nil {
return fmt.Errorf("requestconfig: base url is not set")
}

cfg.Request.URL, err = cfg.BaseURL.Parse(strings.TrimLeft(cfg.Request.URL.String(), "/"))
if err != nil {
return err
Expand Down

0 comments on commit 9e252ee

Please sign in to comment.