diff --git a/httpcache_test.go b/httpcache_test.go index 1a54109..0c1fea8 100644 --- a/httpcache_test.go +++ b/httpcache_test.go @@ -885,6 +885,9 @@ func TestUpdateFields(t *testing.T) { } func TestCachedErrorsKeepStatus(t *testing.T) { + // tests fix for https://github.com/gregjones/httpcache/issues/74 + // previously, after validating a cached response, its StatusCode + // was incorrectly being replaced resetTest() req, err := http.NewRequest("GET", s.server.URL+"/cachederror", nil) if err != nil { @@ -1393,6 +1396,9 @@ func TestStaleIfErrorResponseLifetime(t *testing.T) { } func TestStaleIfErrorKeepsStatus(t *testing.T) { + // tests fix for https://github.com/gregjones/httpcache/issues/74 + // previously, after a stale response was used after encountering an error, + // its StatusCode was being incorrectly replaced resetTest() now := time.Now() tmock := transportMock{