summaryrefslogtreecommitdiffstats
path: root/hugolib
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-08-03 17:52:17 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-08-04 17:16:52 +0200
commita3d42a277d3c492ce4a7860956234134e130aba1 (patch)
treede11e8a6b2a62ffa0308801c194e4dc46851b45d /hugolib
parent2c20fd557afa0a659f716f167d4b9c507654d26b (diff)
Add retry in resources.GetRemote for temporary HTTP errors
Fixes #11312
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/resource_chain_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/hugolib/resource_chain_test.go b/hugolib/resource_chain_test.go
index da90634aa..17c3b2f0c 100644
--- a/hugolib/resource_chain_test.go
+++ b/hugolib/resource_chain_test.go
@@ -36,7 +36,7 @@ func TestResourceChainBasic(t *testing.T) {
failIfHandler := func(h http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/fail.jpg" {
- http.Error(w, "{ msg: failed }", 500)
+ http.Error(w, "{ msg: failed }", 501)
return
}
h.ServeHTTP(w, r)
@@ -116,8 +116,8 @@ FIT REMOTE: sunset_%[1]s.jpg|/sunset_%[1]s_hu59e56ffff1bc1d8d122b1403d34e039f_0_
REMOTE NOT FOUND: OK
LOCAL NOT FOUND: OK
PRINT PROTOCOL ERROR DETAILS: Err: error calling resources.GetRemote: Get "gopher://example.org": unsupported protocol scheme "gopher"||
-FAILED REMOTE ERROR DETAILS CONTENT: |failed to fetch remote resource: Internal Server Error|Body: { msg: failed }
-|StatusCode: 500|ContentLength: 16|ContentType: text/plain; charset=utf-8|
+FAILED REMOTE ERROR DETAILS CONTENT: |failed to fetch remote resource: Not Implemented|Body: { msg: failed }
+|StatusCode: 501|ContentLength: 16|ContentType: text/plain; charset=utf-8|
`, identity.HashString(ts.URL+"/sunset.jpg", map[string]any{})))