From 8241b96fd21cba5f87b1fb8b27a00d1cb8c29c53 Mon Sep 17 00:00:00 2001 From: michiel de wilde Date: Mon, 6 May 2024 09:41:32 +0200 Subject: [PATCH] Add spacelift client type request header (#227) --- client/client.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/client.go b/client/client.go index 8b56af8..f40ac29 100644 --- a/client/client.go +++ b/client/client.go @@ -72,7 +72,11 @@ func (c *client) apiClient(ctx context.Context) (*graphql.Client, error) { return nil, fmt.Errorf("graphql client creation failed at http client creation: %w", err) } - return graphql.NewClient(c.session.Endpoint(), httpC), nil + requestOptions := []graphql.RequestOption{ + graphql.WithHeader("Spacelift-Client-Type", "spacectl"), + } + + return graphql.NewClient(c.session.Endpoint(), httpC, requestOptions...), nil } func (c *client) Do(req *http.Request) (*http.Response, error) {