This repository was archived by the owner on Jan 29, 2020. It is now read-only.
This repository was archived by the owner on Jan 29, 2020. It is now read-only.
RequestTrait #153
Open
Description
::getRequestTarget()
http://tools.ietf.org/html/rfc7230#section-5.3.1
The most common form of request-target is the origin-form.
origin-form = absolute-path [ "?" query ]
The query component is optional, the path is required.
But in code if exists only query - return it
$target = $this->uri->getPath();
if ($this->uri->getQuery()) {
$target .= '?' . $this->uri->getQuery();
}
if (empty($target)) {
$target = '/';
}
probably it would be correct:
$target = $this->uri->getPath();
if (! $target) {
$target = '/';
}
if ($this->uri->getQuery()) {
$target .= '?' . $this->uri->getQuery();
}
return $target;
Metadata
Metadata
Assignees
Labels
No labels