From: Bjørn Erik Pedersen Date: Tue, 30 Sep 2025 15:29:15 +0000 (+0200) Subject: Fix file caching for 404 responses in resources.GetRemote X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=03b33ecb5eb7a02b737627917a1727d0f52867a5;p=brevno-suite%2Fhugo Fix file caching for 404 responses in resources.GetRemote Fixes #14019 --- diff --git a/resources/resource_factories/create/remote.go b/resources/resource_factories/create/remote.go index 51fd0bf8e..c4dffaf95 100644 --- a/resources/resource_factories/create/remote.go +++ b/resources/resource_factories/create/remote.go @@ -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 }