Skip to content

Commit

Permalink
Merge pull request #26 from weierophinney/hotfix/host-header
Browse files Browse the repository at this point in the history
Detail Host header sources
  • Loading branch information
Paul M. Jones committed Mar 4, 2015
2 parents c51a56b + 7d932c5 commit 8ad083e
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions src/RequestInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,58 @@
*/
interface RequestInterface extends MessageInterface
{
/**
* Extends MessageInterface::getHeaders() to provide request-specific
* behavior.
*
* Retrieves all message headers.
*
* This method acts exactly like MessageInterface::getHeaders(), with one
* behavioral change: if the Host header has not been previously set, the
* method MUST attempt to pull the host segment of the composed URI, if
* present.
*
* @see MessageInterface::getHeaders()
* @see UriInterface::getHost()
* @return array Returns an associative array of the message's headers. Each
* key MUST be a header name, and each value MUST be an array of strings.
*/
public function getHeaders();

/**
* Extends MessageInterface::getHeader() to provide request-specific
* behavior.
*
* This method acts exactly like MessageInterface::getHeader(), with
* one behavioral change: if the Host header is requested, but has
* not been previously set, the method MUST attempt to pull the host
* segment of the composed URI, if present.
*
* @see MessageInterface::getHeader()
* @see UriInterface::getHost()
* @param string $name Case-insensitive header field name.
* @return string
*/
public function getHeader($name);

/**
* Extends MessageInterface::getHeaderLines() to provide request-specific
* behavior.
*
* Retrieves a header by the given case-insensitive name as an array of strings.
*
* This method acts exactly like MessageInterface::getHeaderLines(), with
* one behavioral change: if the Host header is requested, but has
* not been previously set, the method MUST attempt to pull the host
* segment of the composed URI, if present.
*
* @see MessageInterface::getHeaderLines()
* @see UriInterface::getHost()
* @param string $name Case-insensitive header field name.
* @return string[]
*/
public function getHeaderLines($name);

/**
* Retrieves the message's request target.
*
Expand Down

0 comments on commit 8ad083e

Please sign in to comment.