Changeset 1267
- Timestamp:
- 08/22/06 13:06:40
- Files:
-
- trunk/cherrypy/lib/cptools.py (modified) (2 diffs)
- trunk/cherrypy/test/test_etags.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/lib/cptools.py
r1261 r1267 28 28 conditions = [str(x) for x in conditions] 29 29 if conditions and not (conditions == ["*"] or etag in conditions): 30 if (status >= 200 and status < 299) or status == 412:30 if status >= 200 and status < 299: 31 31 raise cherrypy.HTTPError(412) 32 32 … … 34 34 conditions = [str(x) for x in conditions] 35 35 if conditions == ["*"] or etag in conditions: 36 if (status >= 200 and status < 299) or status == 304:36 if status >= 200 and status < 299: 37 37 if cherrypy.request.method in ("GET", "HEAD"): 38 38 raise cherrypy.HTTPRedirect([], 304) trunk/cherrypy/test/test_etags.py
r1148 r1267 10 10 return "Oh wah ta goo Siam." 11 11 resource.exposed = True 12 13 def fail(self): 14 raise cherrypy.HTTPError(412) 15 fail.exposed = True 12 16 13 17 conf = { 14 '/ resource': {18 '/': { 15 19 'tools.etags.on': True, 16 20 'tools.etags.autotags': True, … … 57 61 self.getPage("/resource", headers=[('If-None-Match', "a bogus tag")]) 58 62 self.assertStatus("200 OK") 63 64 # Test raising 412 in page handler 65 self.getPage("/fail", headers=[('If-Match', etag)]) 66 self.assertStatus(412) 67 59 68 60 69 if __name__ == "__main__":

