65535)) { throw new InvalidArgumentException(sprintf('Invalid CORS origin: %s', $origin)); } if (('https' === $scheme && 443 === $port) || ('http' === $scheme && 80 === $port)) { $port = null; } return $scheme . '://' . $host . (null === $port ? '' : ':' . $port); } }