Code Duplication    Length = 6-6 lines in 2 locations

lib/private/AppFramework/Http/Request.php 2 locations

@@ 609-614 (lines=6) @@
606
		}
607
608
		if (isset($this->server['HTTP_X_FORWARDED_PROTO'])) {
609
			if (strpos($this->server['HTTP_X_FORWARDED_PROTO'], ',') !== false) {
610
				$parts = explode(',', $this->server['HTTP_X_FORWARDED_PROTO']);
611
				$proto = strtolower(trim($parts[0]));
612
			} else {
613
				$proto = strtolower($this->server['HTTP_X_FORWARDED_PROTO']);
614
			}
615
616
			// Verify that the protocol is always HTTP or HTTPS
617
			// default to http if an invalid value is provided
@@ 772-777 (lines=6) @@
769
	public function getInsecureServerHost() {
770
		$host = 'localhost';
771
		if (isset($this->server['HTTP_X_FORWARDED_HOST'])) {
772
			if (strpos($this->server['HTTP_X_FORWARDED_HOST'], ',') !== false) {
773
				$parts = explode(',', $this->server['HTTP_X_FORWARDED_HOST']);
774
				$host = trim(current($parts));
775
			} else {
776
				$host = $this->server['HTTP_X_FORWARDED_HOST'];
777
			}
778
		} else {
779
			if (isset($this->server['HTTP_HOST'])) {
780
				$host = $this->server['HTTP_HOST'];