Skip to content

Commit 03b33ec

Browse files
committed
Fix file caching for 404 responses in resources.GetRemote
Fixes #14019
1 parent 9928122 commit 03b33ec

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎resources/resource_factories/create/remote.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ func (c *Client) FromRemote(uri string, optionsm map[string]any) (resource.Resou
220220

221221
if res.StatusCode == http.StatusNotFound {
222222
// Not found. This matches how lookups for local resources work.
223+
// To cache this, we need to make sure the body is read.
224+
io.Copy(io.Discard, res.Body)
223225
return nil, nil
224226
}
225227

0 commit comments

Comments
 (0)