Commits

maluke  committed 8720a56

* `set_conditional_response` argument for Response.md5_etag
* minor tweaks for contrib/decorators.py

  • Participants
  • Parent commits 25831a5

Comments (0)

Files changed (1)

File webob/__init__.py

 
     etag = header_getter('ETag', rfc_section='14.19')
 
-    def md5_etag(self, body=None, set_content_md5=False):
+    def md5_etag(self, body=None, set_content_md5=False, set_conditional_response=False):
         """
         Generate an etag for the response object using an MD5 hash of
         the body (the body parameter, or ``self.body`` if not given)
 
         Sets ``self.etag``
         If ``set_content_md5`` is True sets ``self.content_md5`` as well
+        If ``set_conditional_response`` is True sets ``self.conditional_response`` to True
         """
         if body is None:
             body = self.body
         self.etag = md5_digest
         if set_content_md5:
             self.content_md5 = md5_digest
+        if set_conditional_response:
+            self.conditional_response = True
 
     expires = converter(
         header_getter('Expires', rfc_section='14.21'),