Skip to content

Commit 8ad083e

Browse files
author
Paul M. Jones
committed
Merge pull request #26 from weierophinney/hotfix/host-header
Detail Host header sources
2 parents c51a56b + 7d932c5 commit 8ad083e

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

src/RequestInterface.php

+52
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,58 @@
2020
*/
2121
interface RequestInterface extends MessageInterface
2222
{
23+
/**
24+
* Extends MessageInterface::getHeaders() to provide request-specific
25+
* behavior.
26+
*
27+
* Retrieves all message headers.
28+
*
29+
* This method acts exactly like MessageInterface::getHeaders(), with one
30+
* behavioral change: if the Host header has not been previously set, the
31+
* method MUST attempt to pull the host segment of the composed URI, if
32+
* present.
33+
*
34+
* @see MessageInterface::getHeaders()
35+
* @see UriInterface::getHost()
36+
* @return array Returns an associative array of the message's headers. Each
37+
* key MUST be a header name, and each value MUST be an array of strings.
38+
*/
39+
public function getHeaders();
40+
41+
/**
42+
* Extends MessageInterface::getHeader() to provide request-specific
43+
* behavior.
44+
*
45+
* This method acts exactly like MessageInterface::getHeader(), with
46+
* one behavioral change: if the Host header is requested, but has
47+
* not been previously set, the method MUST attempt to pull the host
48+
* segment of the composed URI, if present.
49+
*
50+
* @see MessageInterface::getHeader()
51+
* @see UriInterface::getHost()
52+
* @param string $name Case-insensitive header field name.
53+
* @return string
54+
*/
55+
public function getHeader($name);
56+
57+
/**
58+
* Extends MessageInterface::getHeaderLines() to provide request-specific
59+
* behavior.
60+
*
61+
* Retrieves a header by the given case-insensitive name as an array of strings.
62+
*
63+
* This method acts exactly like MessageInterface::getHeaderLines(), with
64+
* one behavioral change: if the Host header is requested, but has
65+
* not been previously set, the method MUST attempt to pull the host
66+
* segment of the composed URI, if present.
67+
*
68+
* @see MessageInterface::getHeaderLines()
69+
* @see UriInterface::getHost()
70+
* @param string $name Case-insensitive header field name.
71+
* @return string[]
72+
*/
73+
public function getHeaderLines($name);
74+
2375
/**
2476
* Retrieves the message's request target.
2577
*

0 commit comments

Comments
 (0)