Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Moved validation of Uri away from non- RFC3986 compliance to the 'Zen…
Browse files Browse the repository at this point in the history
…d\Uri\UriFactory' method of validation
  • Loading branch information
jas- committed Aug 26, 2013
1 parent e75eab4 commit 35b19ca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Header/Origin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

namespace Zend\Http\Header;

use \Zend\Uri\UriFactory;

/**
* @throws Exception\InvalidArgumentException
* @see http://tools.ietf.org/id/draft-abarth-origin-03.html#rfc.section.2
Expand All @@ -27,7 +29,8 @@ public static function fromString($headerLine)
throw new Exception\InvalidArgumentException('Invalid header line for Origin string: "' . $name . '"');
}

if (!filter_var($value, FILTER_VALIDATE_URL)) {
$uri = UriFactory::factory($value);
if (!$uri->isValid()) {
throw new Exception\InvalidArgumentException('Invalid header value for Origin key: "' . $name . '"');
}

Expand Down

0 comments on commit 35b19ca

Please sign in to comment.