|
@@ 732-737 (lines=6) @@
|
| 729 |
|
public function getInsecureServerHost() { |
| 730 |
|
$host = 'localhost'; |
| 731 |
|
if (isset($this->server['HTTP_X_FORWARDED_HOST'])) { |
| 732 |
|
if (strpos($this->server['HTTP_X_FORWARDED_HOST'], ',') !== false) { |
| 733 |
|
$parts = explode(',', $this->server['HTTP_X_FORWARDED_HOST']); |
| 734 |
|
$host = trim(current($parts)); |
| 735 |
|
} else { |
| 736 |
|
$host = $this->server['HTTP_X_FORWARDED_HOST']; |
| 737 |
|
} |
| 738 |
|
} else { |
| 739 |
|
if (isset($this->server['HTTP_HOST'])) { |
| 740 |
|
$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 |