[pLog-svn] r7209 - plog/branches/lifetype-1.2/class/net/http

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Wed May 15 17:07:54 EDT 2013


Author: jondaley
Date: 2013-05-15 17:07:54 -0400 (Wed, 15 May 2013)
New Revision: 7209

Modified:
   plog/branches/lifetype-1.2/class/net/http/httpcache.class.php
Log:
fixed issue with etags not being different for gzipped and non-gzipped data.  Probably didn't affect any real users, but redbot.org complained about it

Modified: plog/branches/lifetype-1.2/class/net/http/httpcache.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/net/http/httpcache.class.php	2013-05-07 19:08:45 UTC (rev 7208)
+++ plog/branches/lifetype-1.2/class/net/http/httpcache.class.php	2013-05-15 21:07:54 UTC (rev 7209)
@@ -94,7 +94,8 @@
             $_sessionMode=$session;
             $myQuery.=print_r($_SESSION,true).session_name().'='.session_id();
         }
-        $etagServer='"'.md5($scriptName.$myQuery.'#'.$dateLastModif).'"';
+        $acceptEncoding = isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : "";
+        $etagServer='"'.md5($scriptName.$myQuery.'#'.$dateLastModif.$acceptEncoding).'"';
 
         if ((!$is412)&&isset($_SERVER['HTTP_IF_MATCH']))
         {//rfc2616-sec14.html#sec14.24
@@ -197,9 +198,10 @@
         if (isset($_SERVER['QUERY_STRING'])) $myQuery='?'.$_SERVER['QUERY_STRING'];
         else $myQuery='';
         global $_sessionMode;
+        $acceptEncoding = isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : "";
         if ($_sessionMode&&isset($_SESSION))
             $myQuery.=print_r($_SESSION,true).session_name().'='.session_id();
-        $etagServer='"'.md5($scriptName.$myQuery.'#'.$dateLastModif).'"';
+        $etagServer='"'.md5($scriptName.$myQuery.'#'.$dateLastModif.$acceptEncoding).'"';
         
         header('Last-Modified: '.$dateLastModif);
         header('Etag: '.$etagServer);



More information about the pLog-svn mailing list