Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1207

Show
Ignore:
Timestamp:
07/24/06 22:10:26
Author:
fumanchu
Message:

Test and fix for bug in expires tool.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/lib/caching.py

    r1203 r1207  
    186186        secs = (86400 * secs.days) + secs.seconds 
    187187    expiry = http.HTTPDate(cherrypy.response.time + secs) 
    188     cptools.response_headers([("Expires", expiry)], force) 
    189188     
    190189    if secs == 0: 
     
    200199            if cherrypy.request.version >= (1, 1): 
    201200                cptools.response_headers([("Cache-Control", "no-cache")], force) 
     201     
     202    # Set after Pragma, Cache-Control so it doesn't interfere with 'indicators' 
     203    cptools.response_headers([("Expires", expiry)], force) 
  • trunk/cherrypy/test/test_caching.py

    r1203 r1207  
    123123        self.getPage("/expires/force") 
    124124        self.assertStatus("200 OK") 
     125        # This also gives us a chance to test 0 expiry with no other headers 
     126        self.assertHeader("Pragma", "no-cache") 
     127        self.assertHeader("Cache-Control", "no-cache") 
     128        d = self.assertHeader("Date") 
     129        self.assertHeader("Expires", d) 
    125130         
    126131        # static content should now have "cache prevention" headers 

Hosted by WebFaction

Log in as guest/cpguest to create tickets