diff options
Diffstat (limited to 'lib/public/AppFramework/Http')
-rw-r--r-- | lib/public/AppFramework/Http/Attribute/RequestHeader.php | 24 | ||||
-rw-r--r-- | lib/public/AppFramework/Http/Response.php | 4 |
2 files changed, 6 insertions, 22 deletions
diff --git a/lib/public/AppFramework/Http/Attribute/RequestHeader.php b/lib/public/AppFramework/Http/Attribute/RequestHeader.php index c9327eec4c0..1d0fbbfa0c3 100644 --- a/lib/public/AppFramework/Http/Attribute/RequestHeader.php +++ b/lib/public/AppFramework/Http/Attribute/RequestHeader.php @@ -21,30 +21,14 @@ use Attribute; #[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)] class RequestHeader { /** - * @param string $name The name of the request header - * @param string $description The description of the request header + * @param lowercase-string $name The name of the request header + * @param non-empty-string $description The description of the request header + * @param bool $indirect Allow indirect usage of the header for example in a middleware. Enabling this turns off the check which ensures that the header must be referenced in the controller method. */ public function __construct( protected string $name, protected string $description, + protected bool $indirect = false, ) { } - - /** - * @return string The name of the request header. - * - * @since 32.0.0 - */ - public function getName(): string { - return $this->name; - } - - /** - * @return string The description of the request header. - * - * @since 32.0.0 - */ - public function getDescription(): string { - return $this->description; - } } diff --git a/lib/public/AppFramework/Http/Response.php b/lib/public/AppFramework/Http/Response.php index 8037243d7a4..bdebb12c00d 100644 --- a/lib/public/AppFramework/Http/Response.php +++ b/lib/public/AppFramework/Http/Response.php @@ -96,7 +96,7 @@ class Response { $time = \OCP\Server::get(ITimeFactory::class); $expires->setTimestamp($time->getTime()); $expires->add(new \DateInterval('PT' . $cacheSeconds . 'S')); - $this->addHeader('Expires', $expires->format(\DateTimeInterface::RFC2822)); + $this->addHeader('Expires', $expires->format(\DateTimeInterface::RFC7231)); } else { $this->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate'); unset($this->headers['Expires']); @@ -238,7 +238,7 @@ class Response { ]; if ($this->lastModified) { - $mergeWith['Last-Modified'] = $this->lastModified->format(\DateTimeInterface::RFC2822); + $mergeWith['Last-Modified'] = $this->lastModified->format(\DateTimeInterface::RFC7231); } if ($this->ETag) { |