Code Duplication    Length = 6-6 lines in 2 locations

lib/private/appframework/http/request.php 2 locations

@@ 582-587 (lines=6) @@
579
		}
580
581
		if (isset($this->server['HTTP_X_FORWARDED_PROTO'])) {
582
			if (strpos($this->server['HTTP_X_FORWARDED_PROTO'], ',') !== false) {
583
				$parts = explode(',', $this->server['HTTP_X_FORWARDED_PROTO']);
584
				$proto = strtolower(trim($parts[0]));
585
			} else {
586
				$proto = strtolower($this->server['HTTP_X_FORWARDED_PROTO']);
587
			}
588
589
			// Verify that the protocol is always HTTP or HTTPS
590
			// default to http if an invalid value is provided
@@ 749-754 (lines=6) @@
746
	public function getInsecureServerHost() {
747
		$host = 'localhost';
748
		if (isset($this->server['HTTP_X_FORWARDED_HOST'])) {
749
			if (strpos($this->server['HTTP_X_FORWARDED_HOST'], ',') !== false) {
750
				$parts = explode(',', $this->server['HTTP_X_FORWARDED_HOST']);
751
				$host = trim(current($parts));
752
			} else {
753
				$host = $this->server['HTTP_X_FORWARDED_HOST'];
754
			}
755
		} else {
756
			if (isset($this->server['HTTP_HOST'])) {
757
				$host = $this->server['HTTP_HOST'];