Skip to content

Commit 3d52897

Browse files
stainless-app[bot]batuhan
authored andcommitted
fix: only set client options when the corresponding CLI flag or env var is explicitly set
1 parent e307dad commit 3d52897

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

pkg/cmd/cmdutil.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ func getDefaultRequestOptions(cmd *cli.Command) []option.RequestOption {
3636
option.WithHeader("X-Stainless-Package-Version", Version),
3737
option.WithHeader("X-Stainless-Runtime", "cli"),
3838
option.WithHeader("X-Stainless-CLI-Command", cmd.FullName()),
39-
option.WithAccessToken(cmd.String("access-token")),
39+
}
40+
if cmd.IsSet("access-token") {
41+
opts = append(opts, option.WithAccessToken(cmd.String("access-token")))
4042
}
4143

4244
// Override base URL if the --base-url flag is provided

0 commit comments

Comments
 (0)