aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Dag <me@dvikan.no> 2024-03-31 21:02:55 +0200
committerGravatar GitHub <noreply@github.com> 2024-03-31 21:02:55 +0200
commit73289324bd39a31e225bd8f8048a1081bb771c67 (patch)
treee4693460377819886b664e665fce1d6d910911ca /lib
parent8ca1b908400d2965c3ca6aa76b821b7bca7c50e0 (diff)
downloadrss-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.php2
-rw-r--r--lib/http.php9
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;