Merge pull request #18730 from owncloud/appframework_proper_304

Properly return 304 in AppFramework
remotes/origin/db-empty-migrate
Vincent Petry 10 years ago
commit 87b3e28f06
  1. 2
      lib/private/appframework/http.php
  2. 8
      tests/lib/appframework/http/HttpTest.php

@ -121,7 +121,7 @@ class Http extends BaseHttp {
// if etag or lastmodified have not changed, return a not modified
if ((isset($this->server['HTTP_IF_NONE_MATCH'])
&& trim($this->server['HTTP_IF_NONE_MATCH']) === $ETag)
&& trim(trim($this->server['HTTP_IF_NONE_MATCH']), '"') === (string)$ETag)
||

@ -65,6 +65,14 @@ class HttpTest extends \Test\TestCase {
}
public function testQuotedEtagMatchReturnsNotModified() {
$http = new Http(array('HTTP_IF_NONE_MATCH' => '"hi"'));
$header = $http->getStatusHeader(Http::STATUS_OK, null, 'hi');
$this->assertEquals('HTTP/1.1 304 Not Modified', $header);
}
public function testLastModifiedMatchReturnsNotModified() {
$dateTime = new \DateTime(null, new \DateTimeZone('GMT'));
$dateTime->setTimestamp('12');

Loading…
Cancel
Save