Skip to content

Detail Host header sources #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 4, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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