Probable Bug in "OFS.Image.index_html"
Today, I met again a strange problem: I wanted to implement an image relay for an international project: something like: if an image in the target language is available, take it, otherwise, the english image. My DTML looked like: <dtml-let src="have_image(name,language) and _.getitem(language) or EN" image="_.getattr(src,name)" ><dtml-var "image.index_html(REQUEST,RESPONSE)"> The result was very strange: When I forced Netscape to reload the image (SHIFT + reload), everything worked fine. However, when I did a simple reload, it sometimes worked and sometimes did not (showed a broken image). When I loaded the image with Pythons httplib, everything worked fine. I tracked this down to line 219 of "OFS/Image.py": Zope arrives their, when it receives an "IF-MODIFIED-SINCE" header and determines that the browser has an up to date image in its cache. Zope correctly set status 304 and then returns "RESPONSE". It seems that this is not a problem, when "index_html" is directly called from ZPublisher. However, in the context of the above "dtml-var", it confused Netscape completely (I can understand that!). I changed the "return RESPONSE" into "return ''" and everything works fine again. I will put this into the collector. Dieter
What version of Zope are you using? On Fri, Aug 18, 2000 at 08:21:36PM +0200, Dieter Maurer wrote:
Today, I met again a strange problem:
. . .
I tracked this down to line 219 of "OFS/Image.py": Zope arrives their, when it receives an "IF-MODIFIED-SINCE" header and determines that the browser has an up to date image in its cache. Zope correctly set status 304 and then returns "RESPONSE".
------------------------------------------------------ Andres Corrada-Emmanuel Email: andres@corrada.com ------------------------------------------------------
participants (2)
-
andresï¼ corrada.com -
Dieter Maurer