Changeset 1482
- Timestamp:
- 12/09/06 12:40:58
- Files:
-
- branches/cherrypy-2.x/cherrypy/_cperror.py (modified) (1 diff)
- branches/cherrypy-2.x/cherrypy/filters/cachefilter.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/cherrypy-2.x/cherrypy/_cperror.py
r1210 r1482 103 103 response = cherrypy.response 104 104 response.status = status = self.status 105 response.headers['Content-Type'] = "text/html"106 105 107 106 if status in (300, 301, 302, 303, 307): 107 response.headers['Content-Type'] = "text/html" 108 108 109 # "The ... URI SHOULD be given by the Location field 109 110 # in the response." branches/cherrypy-2.x/cherrypy/filters/cachefilter.py
r906 r1482 117 117 # found a hit! check the if-modified-since request header 118 118 expirationTime, lastModified, obj = cacheData 119 s, h, b = obj 119 120 modifiedSince = cherrypy.request.headers.get('If-Modified-Since', None) 120 121 if modifiedSince is not None and modifiedSince == lastModified: 121 122 cherrypy._cache.totNonModified += 1 122 123 cherrypy.response.status = "304 Not Modified" 124 ct = h.get("Content-Type") 125 if ct: 126 cherrypy.response.header_list["Content-Type"] = ct 123 127 cherrypy.response.body = None 124 128 else: 125 129 # serve it & get out from the request 126 cherrypy.response.status, cherrypy.response.header_list, body = obj130 cherrypy.response.status, cherrypy.response.header_list, body = s, h, b 127 131 cherrypy.response.body = body 128 132 raise cherrypy.RequestHandled()

