diff --git a/dhcp/dhcp_linux.go b/dhcp/dhcp_linux.go index a86d642cf1..2c3499d074 100644 --- a/dhcp/dhcp_linux.go +++ b/dhcp/dhcp_linux.go @@ -475,7 +475,7 @@ func (c *DHCP) DHCPRehydrationFeatureOnHost(ctx context.Context) (bool, error) { resp *http.Response httpClient = &http.Client{Timeout: DefaultTimeout} ) - req, err := http.NewRequestWithContext(ctx, http.MethodGet, nmAgentSupportedApisURL, nil) + req, err := http.NewRequestWithContext(ctx, http.MethodGet, nmAgentSupportedApisURL, http.NoBody) if err != nil { return false, errors.Wrap(err, "failed to create http request") } @@ -489,11 +489,11 @@ func (c *DHCP) DHCPRehydrationFeatureOnHost(ctx context.Context) (bool, error) { if resp.StatusCode != http.StatusOK { return false, errResponseNotOK } - bytes, err := io.ReadAll(resp.Body) + readBytes, err := io.ReadAll(resp.Body) if err != nil { return false, errors.Wrap(err, "failed to read response body") } - str := string(bytes) + str := string(readBytes) if !strings.Contains(str, dhcpRehydrationAPIStr) { return false, nil } diff --git a/dhcp/dhcp_windows.go b/dhcp/dhcp_windows.go index 79b58ea16d..d40c01da32 100644 --- a/dhcp/dhcp_windows.go +++ b/dhcp/dhcp_windows.go @@ -21,6 +21,6 @@ func (c *DHCP) DiscoverRequest(_ context.Context, _ net.HardwareAddr, _ string) return nil } -func (c *DHCP) DHCPRehydrationFeatureOnHost(ctx context.Context) (bool, error) { +func (c *DHCP) DHCPRehydrationFeatureOnHost(_ context.Context) (bool, error) { return false, nil }