Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function getProperties($properties) {

return [
'{DAV:}getcontentlength' => 42,
'{DAV:}getlastmodified' => $datetime->format(\DateTimeInterface::RFC7231),
'{DAV:}getlastmodified' => $datetime->format('D, d M Y H:i:s \G\M\T'),
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function afterController($controller, $methodName, Response $response) {
}

$modifiedSinceHeader = $this->request->getHeader('IF_MODIFIED_SINCE');
if ($modifiedSinceHeader !== '' && $response->getLastModified() !== null && trim($modifiedSinceHeader) === $response->getLastModified()->format(\DateTimeInterface::RFC7231)) {
if ($modifiedSinceHeader !== '' && $response->getLastModified() !== null && trim($modifiedSinceHeader) === $response->getLastModified()->format('D, d M Y H:i:s \G\M\T')) {
$response->setStatus(Http::STATUS_NOT_MODIFIED);
return $response;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/public/AppFramework/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function cacheFor(int $cacheSeconds, bool $public = false, bool $immutabl
$time = \OCP\Server::get(ITimeFactory::class);
$expires->setTimestamp($time->getTime());
$expires->add(new \DateInterval('PT' . $cacheSeconds . 'S'));
$this->addHeader('Expires', $expires->format(\DateTimeInterface::RFC7231));
$this->addHeader('Expires', $expires->format('D, d M Y H:i:s \G\M\T'));
} else {
$this->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate');
unset($this->headers['Expires']);
Expand Down Expand Up @@ -240,7 +240,7 @@ public function getHeaders() {
];

if ($this->lastModified) {
$mergeWith['Last-Modified'] = $this->lastModified->format(\DateTimeInterface::RFC7231);
$mergeWith['Last-Modified'] = $this->lastModified->format('D, d M Y H:i:s \G\M\T');
}

if ($this->ETag) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ public static function dataModified(): array {
[null, '"etag"', null, '', false],
['etag', '"etag"', null, '', true],

[null, '', $now, $now->format(\DateTimeInterface::RFC7231), true],
[null, '', $now, $now->format('D, d M Y H:i:s \G\M\T'), true],
[null, '', $now, $now->format(\DateTimeInterface::ATOM), false],
[null, '', null, $now->format(\DateTimeInterface::RFC7231), false],
[null, '', null, $now->format('D, d M Y H:i:s \G\M\T'), false],
[null, '', $now, '', false],

['etag', '"etag"', $now, $now->format(\DateTimeInterface::ATOM), true],
['etag', '"etag"', $now, $now->format(\DateTimeInterface::RFC7231), true],
['etag', '"etag"', $now, $now->format('D, d M Y H:i:s \G\M\T'), true],
];
}

Expand Down
Loading