aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2021-06-23 15:30:43 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2021-06-23 15:30:43 +0200
commit6d5cfe0c66f7010d552f0aa234a13c2e91a933bd (patch)
treea3703e699e9d81ed92019a730ae4f436e3ffb0a2 /lib
parent770881d5d66de36bb04fab8a2b9fdcae658150fa (diff)
downloadnextcloud-server-6d5cfe0c66f7010d552f0aa234a13c2e91a933bd.tar.gz
nextcloud-server-6d5cfe0c66f7010d552f0aa234a13c2e91a933bd.zip
Move DateTime::RFC2822 to DateTimeInterface::2822
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/AppFramework/Middleware/NotModifiedMiddleware.php2
-rw-r--r--lib/private/Files/ObjectStore/S3Signature.php2
-rw-r--r--lib/public/AppFramework/Http/Response.php4
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/AppFramework/Middleware/NotModifiedMiddleware.php b/lib/private/AppFramework/Middleware/NotModifiedMiddleware.php
index dd3f202b6c1..4ebdf10f403 100644
--- a/lib/private/AppFramework/Middleware/NotModifiedMiddleware.php
+++ b/lib/private/AppFramework/Middleware/NotModifiedMiddleware.php
@@ -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;
}
diff --git a/lib/private/Files/ObjectStore/S3Signature.php b/lib/private/Files/ObjectStore/S3Signature.php
index ec2e6bbe3ac..1e5ef697835 100644
--- a/lib/private/Files/ObjectStore/S3Signature.php
+++ b/lib/private/Files/ObjectStore/S3Signature.php
@@ -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
diff --git a/lib/public/AppFramework/Http/Response.php b/lib/public/AppFramework/Http/Response.php
index e28fa0b2c81..ee10d483b25 100644
--- a/lib/public/AppFramework/Http/Response.php
+++ b/lib/public/AppFramework/Http/Response.php
@@ -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();