builder: api calls should have appropriate headers (#14961)

* adding correct headers when posting for validator registration on builder api

* changelog
This commit is contained in:
james-prysm
2025-02-20 08:27:14 -06:00
committed by GitHub
parent 972c22b02f
commit 0f86a16915
4 changed files with 17 additions and 6 deletions

View File

@@ -154,6 +154,10 @@ func (c *Client) do(ctx context.Context, method string, path string, body io.Rea
if err != nil {
return
}
if method == http.MethodPost {
req.Header.Set("Content-Type", api.JsonMediaType)
}
req.Header.Set("Accept", api.JsonMediaType)
req.Header.Add("User-Agent", version.BuildData())
for _, o := range opts {
o(req)