public function resolveOrigin()
    {
        $host = getenv('HTTP_HOST');
        $uri  = '';
        if ($host) {
            $uri = 'http';

            if (getenv('HTTPS') === 'on') {
                $uri .= 's';
            }

            $uri .= '://'.$host;
        }
        $uri .= getenv('REQUEST_URI');

        return $uri;
    }