Revision bd7962c6
Added by Thomas Noël about 15 years ago
| drupal-module/ProxyHandler.class.php | ||
|---|---|---|
|
}
|
||
|
$this->proxy_url = $remote_base_url . $proxied_url;
|
||
|
|
||
|
// extract domainnames (for cookie-proxy)
|
||
|
$local_host = parse_url($local_base_url, PHP_URL_HOST);
|
||
|
list($local_hostname,$local_domainname) = explode('.', $local_host, 2);
|
||
|
$remote_host = parse_url($remote_base_url, PHP_URL_HOST);
|
||
|
list($remote_hostname,$remote_domainname) = explode('.', $remote_host, 2);
|
||
|
$this->local_domainname=$local_domainname;
|
||
|
$this->remote_domainname=$remote_domainname;
|
||
|
|
||
|
$this->translated_url = $this->proxy_url;
|
||
|
|
||
|
$this->curl_handler = curl_init($this->translated_url);
|
||
| ... | ... | |
|
$this->location = $string;
|
||
|
return $length;
|
||
|
}
|
||
|
if (preg_match(',^Set-Cookie:,', $string)) {
|
||
|
if (preg_match(',^Set-Cookie:,', $string)) {
|
||
|
// cookie-proxy
|
||
|
$string = str_replace('domain=' . $this->remote_domainname, 'domain=' . $this->local_domainname, $string);
|
||
|
header(rtrim($string));
|
||
|
}
|
||
|
return $length;
|
||
Also available in: Unified diff
cookie domain adaptation