enable auth for endpoint

This commit is contained in:
Souhaila Noor 2022-01-28 12:10:22 -06:00
parent 1774062f24
commit f58ebbe505

View file

@ -2207,6 +2207,10 @@ func (c *InternalClient) ImportIndexKeys(ctx context.Context, uri *pnet.URI, ind
return errors.Wrap(err, "creating request")
}
httpReq.Header.Set("User-Agent", "pilosa/"+pilosa.Version)
token, ok := ctx.Value("token").(string)
if ok && token != "" {
httpReq.Header.Set("Authorization", token)
}
// Execute request against the host.
resp, err := c.executeRetryableRequest(httpReq.WithContext(ctx))