*/
private function setURL($url) {
$parsedUrl = $originUrl = parse_url($url);
+
+ $this->originUseSSL = $originUrl['scheme'] === 'https';
+ $this->originHost = $originUrl['host'];
+ $this->originPort = isset($originUrl['port']) ? $originUrl['port'] : ($this->originUseSSL ? 443 : 80);
+
if (PROXY_SERVER_HTTP) {
$parsedUrl = parse_url(PROXY_SERVER_HTTP);
+ }
+
+ if (PROXY_SERVER_HTTP && !$this->originUseSSL) {
$this->path = $url;
}
else {
$this->port = isset($parsedUrl['port']) ? $parsedUrl['port'] : ($this->useSSL ? 443 : 80);
$this->query = isset($parsedUrl['query']) ? $parsedUrl['query'] : '';
- $this->originUseSSL = $originUrl['scheme'] === 'https';
- $this->originHost = $originUrl['host'];
- $this->originPort = isset($originUrl['port']) ? $originUrl['port'] : ($this->originUseSSL ? 443 : 80);
-
// update the 'Host:' header if URL has changed
if ($this->url != $url) {
$this->addHeader('host', $this->originHost.($this->originPort != ($this->originUseSSL ? 443 : 80) ? ':'.$this->originPort : ''));