public static function allowFrom(string $allowFromUrl):self
    {
        $middleware = new self(sprintf(self::VALUE_ALLOW_FROM, $allowFromUrl));

        if (!filter_var($allowFromUrl, FILTER_VALIDATE_URL)) {
            throw new MiddlewareException(
                $middleware,
                sprintf("'%s' is not a valid URL", $allowFromUrl)
            );
        }

        return $middleware;
    }