Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
fixup! Refrain from setting 200 OK on cached responses
Browse files Browse the repository at this point in the history
  • Loading branch information
gregjones committed Nov 16, 2017
1 parent 06cbfd4 commit 7b04367
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions httpcache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit 7b04367

Please sign in to comment.