Skip to content

Commit 31e286c

Browse files
committed
Add Response::negotiateDate method
1 parent 154d349 commit 31e286c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/Response.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,9 +517,7 @@ protected function sendHeaders() : void
517517
if ($this->headersSent || \headers_sent()) {
518518
throw new LogicException('Headers are already sent');
519519
}
520-
if ($this->getHeader(ResponseHeader::DATE) === null) {
521-
$this->setDate();
522-
}
520+
$this->negotiateDate();
523521
$this->negotiateContentType();
524522
$this->negotiateEtag();
525523
$this->negotiateCsp();
@@ -668,6 +666,13 @@ protected function negotiateEtag() : void
668666
}
669667
}
670668

669+
protected function negotiateDate() : void
670+
{
671+
if ($this->getHeader(ResponseHeader::DATE) === null) {
672+
$this->setDate();
673+
}
674+
}
675+
671676
/**
672677
* Set Response body and Content-Type as JSON.
673678
*

0 commit comments

Comments
 (0)