[Checkins] SVN: z3c.resourcecollector/trunk/ - Temporary fix because getting the resources to calculate the hash destroys

Juergen Kartnaller juergen at kartnaller.at
Tue Feb 5 02:03:38 EST 2008


Log message for revision 83519:
   - Temporary fix because getting the resources to calculate the hash destroys
     the request (at leaset changes headers).
  
  

Changed:
  U   z3c.resourcecollector/trunk/CHANGES.txt
  U   z3c.resourcecollector/trunk/setup.py
  U   z3c.resourcecollector/trunk/src/z3c/resourcecollector/utility.py

-=-
Modified: z3c.resourcecollector/trunk/CHANGES.txt
===================================================================
--- z3c.resourcecollector/trunk/CHANGES.txt	2008-02-05 07:02:46 UTC (rev 83518)
+++ z3c.resourcecollector/trunk/CHANGES.txt	2008-02-05 07:03:36 UTC (rev 83519)
@@ -3,8 +3,14 @@
 ================================
 
 TODO: add tests for the viewlets !!!!
+      Fix the workaround in getUrl of the utility.
 
+2008/02/01 1.0.2
+----------------
 
+ - Temporary fix because getting the resources to calculate the hash destroys
+   the request (at leaset changes headers).
+
 2008/02/01 1.0.1
 ----------------
 

Modified: z3c.resourcecollector/trunk/setup.py
===================================================================
--- z3c.resourcecollector/trunk/setup.py	2008-02-05 07:02:46 UTC (rev 83518)
+++ z3c.resourcecollector/trunk/setup.py	2008-02-05 07:03:36 UTC (rev 83519)
@@ -3,7 +3,7 @@
 from setuptools import setup, find_packages, Extension
 
 setup(name='z3c.resourcecollector',
-      version='1.0.1',
+      version='1.0.2',
       url='https://svn.lovelysystems.com/repos/dev/package/z3c.resourcecollector',
       license='ZPL',
       description='',

Modified: z3c.resourcecollector/trunk/src/z3c/resourcecollector/utility.py
===================================================================
--- z3c.resourcecollector/trunk/src/z3c/resourcecollector/utility.py	2008-02-05 07:02:46 UTC (rev 83518)
+++ z3c.resourcecollector/trunk/src/z3c/resourcecollector/utility.py	2008-02-05 07:03:36 UTC (rev 83519)
@@ -29,7 +29,13 @@
         self.content_type = content_type
 
     def getUrl(self,context,request):
+        #XXX: fix this workaround :
+        #  getting the resources to calculate the hash changes the request,
+        #  because the resource getter also sets response headers.
+        h = {}
+        h.update(request.response._headers)
         filetoreturn = self.getResources(request)
+        request.response._headers = h
         x = sha.new()
         x.update(filetoreturn)
         return x.hexdigest()



More information about the Checkins mailing list