Fix file caching for 404 responses in resources.GetRemote

Fixes #14019
This commit is contained in:
Bjørn Erik Pedersen
2025-09-30 17:29:15 +02:00
parent 9928122eb8
commit 03b33ecb5e
@@ -220,6 +220,8 @@ func (c *Client) FromRemote(uri string, optionsm map[string]any) (resource.Resou
if res.StatusCode == http.StatusNotFound {
// Not found. This matches how lookups for local resources work.
// To cache this, we need to make sure the body is read.
io.Copy(io.Discard, res.Body)
return nil, nil
}