Skip to content

Commit

Permalink
Ensure HTTP client urls are absolute
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksleight committed Feb 12, 2016
1 parent dd80645 commit 65eafec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public function method($method = null)
public function url(Url $url = null)
{
if (func_num_args() > 0) {
if (!$url->isHttp()) {
throw new \Exception("URL scheme is not HTTP or HTTPS");
if (!$url->isHttp() || !$url->isAbsolute()) {
throw new \Exception("URL must be HTTP and absolute");
}
$this->_url = $url;
return $this;
Expand Down

0 comments on commit 65eafec

Please sign in to comment.