diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2015-09-01 10:40:44 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2015-09-01 11:04:41 +0200 |
commit | f12caf930eb375ef60b741265fb331da4d615504 (patch) | |
tree | a09f6bc333d6e7dc9def691ac2a66d281dd045b6 /tests/lib/appframework/http | |
parent | e367f1bfc109cbb5095894279d1b6b7c15a9f428 (diff) | |
download | nextcloud-server-f12caf930eb375ef60b741265fb331da4d615504.tar.gz nextcloud-server-f12caf930eb375ef60b741265fb331da4d615504.zip |
Properly return 304
The ETag set in the IF_NONE_MODIFIED header is wraped in quotes (").
However the ETag that is set in response is not (yet). Also we need to
cast the ETag to a string.
* Added unit test
Diffstat (limited to 'tests/lib/appframework/http')
-rw-r--r-- | tests/lib/appframework/http/HttpTest.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/lib/appframework/http/HttpTest.php b/tests/lib/appframework/http/HttpTest.php index e9be3e73904..4bcc8305db4 100644 --- a/tests/lib/appframework/http/HttpTest.php +++ b/tests/lib/appframework/http/HttpTest.php @@ -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'); |