public function getOrigin(): string
    {
        $requestOrigin = $this->request->getOrigin();
        $hasWildcard = in_array('*', $this->origins);

        // The origin is seted "*"?
        if ($hasWildcard && !$requestOrigin) {
            return '*';
        }

        // Get request heaer origin line.
        // If the request origin in config
        // to be origins return the request origin value.
        if (in_array($requestOrigin, $this->origins) || $hasWildcard) {
            return $requestOrigin;
        }

        // Return empty.
        return '';
    }