Skip to content

Commit 4385fad

Browse files
support host header param (#22)
Signed-off-by: Morgan Gallant <morgan@morgangallant.com>
1 parent e4237db commit 4385fad

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

main.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,18 @@ func run(ctx context.Context, shutdown context.CancelFunc) error {
5555
}
5656
}
5757

58-
client := turbopuffer.NewClient(
58+
tpufOptions := []tpufOption.RequestOption{
5959
tpufOption.WithAPIKey(*apiKey),
6060
tpufOption.WithBaseURL(*endpoint),
6161
tpufOption.WithHTTPClient(&http.Client{
6262
Transport: &transport,
6363
}),
64-
)
64+
}
65+
if *hostHeader != "" {
66+
tpufOptions = append(tpufOptions, tpufOption.WithHeader("Host", *hostHeader))
67+
}
68+
69+
client := turbopuffer.NewClient(tpufOptions...)
6570

6671
// Script should be run via a cloud VM
6772
likelyCloudVM, err := likelyRunningOnCloudVM(ctx)

0 commit comments

Comments
 (0)