private static function isValidOrigin(RequestInterface $request): bool
    {
        if (!self::compareHeaderUrl($request, 'Origin')) {
            return false;
        }

        if (!self::compareHeaderUrl($request, 'Referer')) {
            return false;
        }

        return true;
    }