Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 638-643 (lines=6) @@
635
		}
636
637
		if (isset($this->server['HTTP_X_FORWARDED_PROTO'])) {
638
			if (strpos($this->server['HTTP_X_FORWARDED_PROTO'], ',') !== false) {
639
				$parts = explode(',', $this->server['HTTP_X_FORWARDED_PROTO']);
640
				$proto = strtolower(trim($parts[0]));
641
			} else {
642
				$proto = strtolower($this->server['HTTP_X_FORWARDED_PROTO']);
643
			}
644
645
			// Verify that the protocol is always HTTP or HTTPS
646
			// default to http if an invalid value is provided
@@ 801-806 (lines=6) @@
798
	public function getInsecureServerHost() {
799
		$host = 'localhost';
800
		if (isset($this->server['HTTP_X_FORWARDED_HOST'])) {
801
			if (strpos($this->server['HTTP_X_FORWARDED_HOST'], ',') !== false) {
802
				$parts = explode(',', $this->server['HTTP_X_FORWARDED_HOST']);
803
				$host = trim(current($parts));
804
			} else {
805
				$host = $this->server['HTTP_X_FORWARDED_HOST'];
806
			}
807
		} else {
808
			if (isset($this->server['HTTP_HOST'])) {
809
				$host = $this->server['HTTP_HOST'];