]> git.maquefel.me Git - brevno-suite/hugo/commit
resources: Fix context canceled on GetRemote with per-request timeout
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 10 Mar 2026 09:15:37 +0000 (10:15 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 10 Mar 2026 18:45:14 +0000 (19:45 +0100)
commit842d8f105256c5656e7895ee61fa5b2dfe90a9e3
tree760f0a40ca7a9ebaaa7c693860077d2f468f395c
parentc47ec23342a77e923622ef9c2616ccf6275fe774
resources: Fix context canceled on GetRemote with per-request timeout

The per-request timeout context was cancelled via defer in the getRes
closure, before io.ReadAll(res.Body) in the outer scope could read
the response body. Fix this by returning the cancel function from
getRes so each caller manages its own cancel lifecycle.

Fixes #14611

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
resources/resource_factories/create/create_integration_test.go
resources/resource_factories/create/remote.go