|
@@ 746-751 (lines=6) @@
|
| 743 |
|
public function getInsecureServerHost() { |
| 744 |
|
$host = 'localhost'; |
| 745 |
|
if (isset($this->server['HTTP_X_FORWARDED_HOST'])) { |
| 746 |
|
if (strpos($this->server['HTTP_X_FORWARDED_HOST'], ',') !== false) { |
| 747 |
|
$parts = explode(',', $this->server['HTTP_X_FORWARDED_HOST']); |
| 748 |
|
$host = trim(current($parts)); |
| 749 |
|
} else { |
| 750 |
|
$host = $this->server['HTTP_X_FORWARDED_HOST']; |
| 751 |
|
} |
| 752 |
|
} else { |
| 753 |
|
if (isset($this->server['HTTP_HOST'])) { |
| 754 |
|
$host = $this->server['HTTP_HOST']; |
|
@@ 564-569 (lines=6) @@
|
| 561 |
|
} |
| 562 |
|
|
| 563 |
|
if (isset($this->server['HTTP_X_FORWARDED_PROTO'])) { |
| 564 |
|
if (strpos($this->server['HTTP_X_FORWARDED_PROTO'], ',') !== false) { |
| 565 |
|
$parts = explode(',', $this->server['HTTP_X_FORWARDED_PROTO']); |
| 566 |
|
$proto = strtolower(trim($parts[0])); |
| 567 |
|
} else { |
| 568 |
|
$proto = strtolower($this->server['HTTP_X_FORWARDED_PROTO']); |
| 569 |
|
} |
| 570 |
|
|
| 571 |
|
// Verify that the protocol is always HTTP or HTTPS |
| 572 |
|
// default to http if an invalid value is provided |