mirror of
https://github.com/tailscale/tailscale.git
synced 2025-02-22 12:58:37 +00:00
prober: used keyed initializer for LimitedReader.
Reported by go vet. Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
parent
909f40da84
commit
7c7f37342f
@ -49,7 +49,7 @@ func probeHTTP(ctx context.Context, url string, want []byte) error {
|
|||||||
return fmt.Errorf("fetching %q: status code %d, want 200", url, resp.StatusCode)
|
return fmt.Errorf("fetching %q: status code %d, want 200", url, resp.StatusCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
bs, err := io.ReadAll(&io.LimitedReader{resp.Body, maxHTTPBody})
|
bs, err := io.ReadAll(io.LimitReader(resp.Body, maxHTTPBody))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("reading body of %q: %w", url, err)
|
return fmt.Errorf("reading body of %q: %w", url, err)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user