Path

ez projects / xrowcdn / forum / general / small bug in zend s3.php


Small bug in Zend S3.php

You need to be logged in to post messages in the forums. New users may register here.

Fredrik Ardmar

Member since:
30 November 1999

Posts: 9

Sunday 04 October 2009 7:51:03 pm

Hi

Unfortunately there is a small bug in the s3.php file in the Zend framework. If you use gzip on for example a js or css file and that is uploaded before the images, then all images will also get content encoding as gzip. This leads to the browser not being able to view the images. This is due to a small bug in the zend HTTP client.

Its easy to get around it by adding an extra line of code to s3.php.

Just change this:




 $client->setHeaders(array('Content-MD5' => null,


                                 'Expect'     => null,


                                 'Range'      => null,


                                 'x-amz-acl'  => null));


 


To this:



 $client->setHeaders(array('Content-MD5' => null,


                                 'Expect'     => null,


                                 'Range'      => null,


                                 'x-amz-acl'  => null,


                                 'Content-Encoding'=> null));


 


By setting the Content-Encoding to null we make sure this is reset for every new object.

Fredrik
Up

You need to be logged in to post messages in the forums. New users may register here.