Skip to content

Commit 51b772d

Browse files
committed
Revert "Merge branch 'mcuadros-cache-key'"
This reverts commit 5a50314, reversing changes made to 553cabb.
1 parent 5a50314 commit 51b772d

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

‎httpcache.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type Cache interface {
3939

4040
// cacheKey returns the cache key for req.
4141
func cacheKey(req *http.Request) string {
42-
return fmt.Sprintf("%s_%s", req.Method, req.URL.String())
42+
return req.URL.String()
4343
}
4444

4545
// CachedResponse returns the cached http.Response for req if present, and nil

‎httpcache_test.go‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -401,18 +401,3 @@ func (s *S) TestMaxStaleValue(c *C) {
401401

402402
c.Assert(getFreshness(respHeaders, reqHeaders), Equals, stale)
403403
}
404-
405-
func (s *S) TestGetAndHeadSameUrl(c *C) {
406-
req, err := http.NewRequest("HEAD", s.server.URL+"/", nil)
407-
req.Header.Set("Accept", "text/plain")
408-
resp, err := s.client.Do(req)
409-
defer resp.Body.Close()
410-
c.Assert(err, IsNil)
411-
c.Assert(resp.Header.Get(XFromCache), Equals, "")
412-
413-
req2, err := http.NewRequest("GET", s.server.URL+"/", nil)
414-
resp2, err2 := s.client.Do(req2)
415-
defer resp2.Body.Close()
416-
c.Assert(err2, IsNil)
417-
c.Assert(resp2.Header.Get(XFromCache), Equals, "")
418-
}

0 commit comments

Comments
 (0)