mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Move DateTime::RFC2822 to DateTimeInterface::2822
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
770881d5d6
commit
6d5cfe0c66
5 changed files with 8 additions and 8 deletions
|
|
@ -76,7 +76,7 @@ class AppleProvisioningNode implements INode, IProperties {
|
|||
|
||||
return [
|
||||
'{DAV:}getcontentlength' => 42,
|
||||
'{DAV:}getlastmodified' => $datetime->format(\DateTime::RFC2822),
|
||||
'{DAV:}getlastmodified' => $datetime->format(\DateTimeInterface::RFC2822),
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class NotModifiedMiddleware extends Middleware {
|
|||
}
|
||||
|
||||
$modifiedSinceHeader = $this->request->getHeader('IF_MODIFIED_SINCE');
|
||||
if ($modifiedSinceHeader !== '' && $response->getLastModified() !== null && trim($modifiedSinceHeader) === $response->getLastModified()->format(\DateTime::RFC2822)) {
|
||||
if ($modifiedSinceHeader !== '' && $response->getLastModified() !== null && trim($modifiedSinceHeader) === $response->getLastModified()->format(\DateTimeInterface::RFC2822)) {
|
||||
$response->setStatus(Http::STATUS_NOT_MODIFIED);
|
||||
return $response;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ class S3Signature implements SignatureInterface {
|
|||
) {
|
||||
$modify = [
|
||||
'remove_headers' => ['X-Amz-Date'],
|
||||
'set_headers' => ['Date' => gmdate(\DateTime::RFC2822)]
|
||||
'set_headers' => ['Date' => gmdate(\DateTimeInterface::RFC2822)]
|
||||
];
|
||||
|
||||
// Add the security token header if one is being used by the credentials
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ class Response {
|
|||
$time = \OC::$server->query(ITimeFactory::class);
|
||||
$expires->setTimestamp($time->getTime());
|
||||
$expires->add(new \DateInterval('PT'.$cacheSeconds.'S'));
|
||||
$this->addHeader('Expires', $expires->format(\DateTime::RFC2822));
|
||||
$this->addHeader('Expires', $expires->format(\DateTimeInterface::RFC2822));
|
||||
} else {
|
||||
$this->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate');
|
||||
unset($this->headers['Expires'], $this->headers['Pragma']);
|
||||
|
|
@ -244,7 +244,7 @@ class Response {
|
|||
|
||||
if ($this->lastModified) {
|
||||
$mergeWith['Last-Modified'] =
|
||||
$this->lastModified->format(\DateTime::RFC2822);
|
||||
$this->lastModified->format(\DateTimeInterface::RFC2822);
|
||||
}
|
||||
|
||||
$this->headers['Content-Security-Policy'] = $this->getContentSecurityPolicy()->buildPolicy();
|
||||
|
|
|
|||
|
|
@ -61,13 +61,13 @@ class NotModifiedMiddlewareTest extends \Test\TestCase {
|
|||
[null, '"etag"', null, '', false],
|
||||
['etag', '"etag"', null, '', true],
|
||||
|
||||
[null, '', $now, $now->format(\DateTime::RFC2822), true],
|
||||
[null, '', $now, $now->format(\DateTimeInterface::RFC2822), true],
|
||||
[null, '', $now, $now->format(\DateTimeInterface::ATOM), false],
|
||||
[null, '', null, $now->format(\DateTime::RFC2822), false],
|
||||
[null, '', null, $now->format(\DateTimeInterface::RFC2822), false],
|
||||
[null, '', $now, '', false],
|
||||
|
||||
['etag', '"etag"', $now, $now->format(\DateTimeInterface::ATOM), true],
|
||||
['etag', '"etag"', $now, $now->format(\DateTime::RFC2822), true],
|
||||
['etag', '"etag"', $now, $now->format(\DateTimeInterface::RFC2822), true],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue