app/code/community/Nexcessnet/Turpentine/Helper/Esi.php
public function getCorsOrigin($url = null) {
        if (is_null($url)) {
            $baseUrl = Mage::getBaseUrl();
        } else {
            $baseUrl = $url;
        }
        $path = parse_url($baseUrl, PHP_URL_PATH);
        $domain = parse_url($baseUrl, PHP_URL_HOST);
        // there has to be a better way to just strip the path off
        return substr($baseUrl, 0,
            strpos($baseUrl, $path,
                strpos($baseUrl, $domain)));
    }
public function getCorsOrigin($url = null) {
        if (is_null($url)) {
            $baseUrl = Mage::getBaseUrl();
        } else {
            $baseUrl = $url;
        }
        $path = parse_url($baseUrl, PHP_URL_PATH);
        $domain = parse_url($baseUrl, PHP_URL_HOST);
        // there has to be a better way to just strip the path off
        return substr($baseUrl, 0,
            strpos($baseUrl, $path,
                strpos($baseUrl, $domain)));
    }
public function getCorsOrigin ( $ url = null ) { if ( is_null ( $ url ) ) { $ baseUrl = Mage :: getBaseUrl ( ) ; } else { $ baseUrl = $ url ; } $ path = parse_url ( $ baseUrl , PHP_URL_PATH ) ; $ domain = parse_url ( $ baseUrl , PHP_URL_HOST ) ; // there has to be a better way to just strip the path off return substr ( $ baseUrl , 0 , strpos ( $ baseUrl , $ path , strpos ( $ baseUrl , $ domain ) ) ) ; }
Get the CORS origin field from the unsecure base URL

If this isn't added to AJAX responses they won't load properly

@return string
Get the CORS origin field from the unsecure base URL