Skip to content

Commit 43330d7

Browse files
committed
Detail Host header sources
Per the [related PR for fig-standards](php-fig/fig-standards#446), this PR updates the `RequestInterface` to override the `getHeader()` method and indicate that the Host header should be pulled from the composed URI if no value has been previously set.
1 parent 4727540 commit 43330d7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/RequestInterface.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,22 @@
2020
*/
2121
interface RequestInterface extends MessageInterface
2222
{
23+
/**
24+
* Extends MessageInterface::getHeader() to provide request-specific
25+
* behavior.
26+
*
27+
* This method acts exactly like MessageInterface::getHeader(), with
28+
* one behavioral change: if the Host header is requested, but has
29+
* not been previously set, the method SHOULD attempt to pull the host
30+
* segment of the composed URI, if present.
31+
*
32+
* @see MessageInterface::getHeader()
33+
* @see UriInterface::getHost()
34+
* @param string $name Case-insensitive header field name.
35+
* @return string
36+
*/
37+
public function getHeader($name);
38+
2339
/**
2440
* Retrieves the message's request target.
2541
*

0 commit comments

Comments
 (0)