[Pkg-owncloud-commits] [php-sabredav] 05/06: Fixed behaviour for If-Modified-Since and If-Unmodified-Since for exact date matches.

David Prévot taffit at moszumanska.debian.org
Sat Nov 30 15:44:21 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to tag version-1.2.5
in repository php-sabredav.

commit 4705b5f997e28ea54c173721bf1b6a7bf2c72cda
Author: Evert Pot <evert at rooftopsolutions.nl>
Date:   Wed Jul 21 23:25:07 2010 +0200

    Fixed behaviour for If-Modified-Since and If-Unmodified-Since for exact date matches.
---
 ChangeLog                | 2 ++
 lib/Sabre/DAV/Server.php | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 307046e..449b8be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
 1.2.5 (2010-08-18)
 	* Fixed: Issue 73: guessBaseUrl fails for some servers.
 	* Fixed: Issue 67: SabreDAV works better with non-seekable streams.
+	* Fixed: If-Modified-Since and If-Unmodified-Since would be incorrect if
+	  the date is an exact match.  
 
 1.2.4 (2010-07-13)
 	* Fixed: Issue 62: Guessing baseUrl fails when url contains a
diff --git a/lib/Sabre/DAV/Server.php b/lib/Sabre/DAV/Server.php
index 4b62ebf..77f606b 100644
--- a/lib/Sabre/DAV/Server.php
+++ b/lib/Sabre/DAV/Server.php
@@ -1652,7 +1652,7 @@ class Sabre_DAV_Server {
             $lastMod = $node->getLastModified();
             if ($lastMod) {
                 $lastMod = new DateTime('@' . $lastMod);
-                if ($lastMod < $date) {
+                if ($lastMod <= $date) {
                     $this->httpResponse->sendStatus(304);
                     return false;
                 } 
@@ -1671,7 +1671,7 @@ class Sabre_DAV_Server {
             $lastMod = $node->getLastModified();
             if ($lastMod) {
                 $lastMod = new DateTime('@' . $lastMod);
-                if ($lastMod >= $date) {
+                if ($lastMod > $date) {
                     throw new Sabre_DAV_Exception_PreconditionFailed('An If-Unmodified-Since header was specified, but the entity has been changed since the specified date.','If-Unmodified-Since');
                 }
             }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git



More information about the Pkg-owncloud-commits mailing list