]> source.dussan.org Git - nextcloud-server.git/commitdiff
Contacts+OC_Respone: Move enableCaching out of setEtagHeader and setLastModifiedHeader
authorBart Visscher <bartv@thisnet.nl>
Mon, 13 Feb 2012 21:47:31 +0000 (22:47 +0100)
committerBart Visscher <bartv@thisnet.nl>
Mon, 13 Feb 2012 21:47:31 +0000 (22:47 +0100)
apps/contacts/photo.php
apps/contacts/thumbnail.php
lib/response.php

index 314bce7cecce162528feb43ca38c36344b5924ba..8dfbcb6fb107817833c5c9e72f2f39efc428d6ea 100644 (file)
@@ -21,6 +21,7 @@ $image = new OC_Image();
 if( is_null($contact)) {
        OC_Log::write('contacts','photo.php. The VCard for ID '.$id.' is not RFC compatible',OC_Log::ERROR);
 } else {
+       OC_Response::enableCaching();
        OC_Contacts_App::setLastModifiedHeader($contact);
 
        // Photo :-)
index c020c29ac8c682b199deb3f2dc3cdb4399766a5d..39da6bc2bf73d2f831c56a980a318145c418326f 100644 (file)
@@ -48,6 +48,7 @@ if(is_null($contact)){
        getStandardImage();
        exit();
 }
+OC_Response::enableCaching();
 OC_Contacts_App::setLastModifiedHeader($contact);
 
 $thumbnail_size = 23;
index b5fca1cb2279cbb1f313b205e59d37d250b23cd5..a768366b02c2e1c3d4f153914e9726954875bd1c 100644 (file)
@@ -63,6 +63,7 @@ class OC_Response {
                        $expires->add(new DateInterval($interval));
                }
                if ($expires instanceof DateTime) {
+                       $expires->setTimezone(new DateTimeZone('GMT'));
                        $expires = $expires->format(DateTime::RFC2822);
                }
                header('Expires: '.$expires);
@@ -72,7 +73,6 @@ class OC_Response {
                if (empty($etag)) {
                        return;
                }
-               self::enableCaching();
                if (isset($_SERVER['HTTP_IF_NONE_MATCH']) &&
                    trim($_SERVER['HTTP_IF_NONE_MATCH']) == $etag) {
                        self::setStatus(self::STATUS_NOT_MODIFIED);
@@ -88,7 +88,6 @@ class OC_Response {
                if ($lastModified instanceof DateTime) {
                        $lastModified = $lastModified->format(DateTime::RFC2822);
                }
-               self::enableCaching();
                if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) &&
                    trim($_SERVER['HTTP_IF_MODIFIED_SINCE']) == $lastModified) {
                        self::setStatus(self::STATUS_NOT_MODIFIED);