diff options
author | 2024-03-31 21:02:55 +0200 | |
---|---|---|
committer | 2024-03-31 21:02:55 +0200 | |
commit | 73289324bd39a31e225bd8f8048a1081bb771c67 (patch) | |
tree | e4693460377819886b664e665fce1d6d910911ca /lib | |
parent | 8ca1b908400d2965c3ca6aa76b821b7bca7c50e0 (diff) | |
download | rss-bridge-73289324bd39a31e225bd8f8048a1081bb771c67.tar.gz rss-bridge-73289324bd39a31e225bd8f8048a1081bb771c67.tar.zst rss-bridge-73289324bd39a31e225bd8f8048a1081bb771c67.zip |
feat: add vendor http header to cached responses (#4040)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/FeedItem.php | 2 | ||||
-rw-r--r-- | lib/http.php | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/FeedItem.php b/lib/FeedItem.php index bd37f119..fc4549a7 100644 --- a/lib/FeedItem.php +++ b/lib/FeedItem.php @@ -178,7 +178,6 @@ class FeedItem } else { $this->author = $author; } - return $this; } public function getContent(): ?string @@ -284,7 +283,6 @@ class FeedItem } else { $this->misc[$name] = $value; } - return $this; } public function toArray(): array diff --git a/lib/http.php b/lib/http.php index e4f9bf48..39f0c727 100644 --- a/lib/http.php +++ b/lib/http.php @@ -331,7 +331,14 @@ final class Response return array_pop($header); } - public function withBody(string $body): Response + public function withHeader(string $name, string $value): self + { + $clone = clone $this; + $clone->headers[$name] = [$value]; + return $clone; + } + + public function withBody(string $body): self { $clone = clone $this; $clone->body = $body; |