aboutsummaryrefslogtreecommitdiffstats
path: root/lib/response.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/response.php')
-rw-r--r--lib/response.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/response.php b/lib/response.php
index 5f095a0affd..7733168b5b9 100644
--- a/lib/response.php
+++ b/lib/response.php
@@ -42,6 +42,18 @@ class OC_Response {
header('Location: '.$location);
}
+ static public function setExpiresHeader($expires) {
+ if (is_string($expires) && $expires[0] == 'P') {
+ $interval = $expires;
+ $expires = new DateTime('now');
+ $expires->add(new DateInterval(expires));
+ }
+ if ($expires instanceof DateTime) {
+ $expires = $expires->format(DateTime::RFC2822);
+ }
+ header('Expires: '.expires);
+ }
+
static public function setETagHeader($etag) {
if (empty($etag)) {
return;